Re: How to do a "SELECT DISTINCT"
Re: How to do a "SELECT DISTINCT"
- Subject: Re: How to do a "SELECT DISTINCT"
- From: Robert Walker <email@hidden>
- Date: Wed, 23 Mar 2005 09:52:13 -0500
fs.setRawRowKeyPaths(new NSArray("id"));
fs.setFetchesRawRows(true);
fs.setUsesDistinct(true);
Yes, this is very much on track. Just keep in mind that you will not be able to make EOEnterpriseObjects out of these raw rows because you cannot include your primary key in fs.setRawRowKeyPaths(NSArray
keyPaths) (otherwise SELECT DISTINCT would do exactly what fetching objects would do).
So you'll need to read the data directly out of the raw row array of dictionaries (row snapshots).
On Mar 22, 2005, at 6:07 PM, Denis Stanton wrote:
I think my answer below was hasty. I have used fetchSpec.setUsesDistinct(true); but I use in the sequence below. Maybe it is not useful unless you are reading raw rows.
fs.setRawRowKeyPaths(new NSArray("id"));
fs.setFetchesRawRows(true);
fs.setUsesDistinct(true);
On Mar 23, 2005, at 10:28 AM, Denis Stanton wrote:
On Mar 23, 2005, at 9:03 AM, Sébastien Gruhier wrote:
Hi,
I would like to perform a "select distinct" on my database.
Actually I do a fecthSpecification like this
EOFetchSpecification fetchSpec = new EOFetchSpecification("Table",
new EOKeyValueQualifier("attribute",
EOQualifier.QualifierOperatorEqual,
new Integer(1)),
null);
fetchSpec.setUsesDistinct(true);
editingContext.objectsWithFetchSpecification(fetchSpec);
<x-tad-smaller>Denis Stanton
Orcon Internet Limited
(09) 480 9299
</x-tad-smaller><x-tad-smaller>http://www.orcon.net.nz
</x-tad-smaller><x-tad-smaller>
</x-tad-smaller>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
<x-tad-smaller>Denis Stanton
Orcon Internet Limited
(09) 480 9299
</x-tad-smaller><x-tad-smaller>http://www.orcon.net.nz
</x-tad-smaller><x-tad-smaller>
</x-tad-smaller>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Robert Walker
Bennett Technology Group
(770) 957-1866 Ext: 790
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden