Hi Raynond,

I do not think it is possible to specify UNION like that and the way the sql 
are generated probably prohibit it.

If your results are small, the easy way is to merge your results in memory:

NSArray result = firstFetch();
result.arrayByAddingObjectsFromArray(secondFetchInSameEntity);
result = ERXArrayUtilities.arrayWithoutDuplicates(result);

If your result are bigger but not huge, you may try to use a Set to merge the 
results by adding both results in the set and create an array with the 
resulting set. By definition, Set does not allow duplicates.

If you really need UNION in the database, you will need to use an internal 
procedure or a custom SQL query.

Samuel


Le 2013-10-04 à 08:02, Raymond NANEON <[email protected]> a écrit :

> The UNION is on the same EOEntity. 
> 
> Thanks
> Envoyé depuis iCloud
> 
> Le 04 oct. 2013 à 14:00, Raymond NANEON <[email protected]> a écrit :
> 
>> Hi List,
>> 
>> I want to use UNION in two EOFetch but I don't know how to do it.
>> 
>> Thanks for your help.
>> Envoyé depuis iCloud
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/rnaneon%40me.com
>> 
>> This email sent to [email protected]
>>  
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to