>>>Hi everybody,
>>>
>>>I'm getting the title's error on this SQL
>>>
>>>
>>>SELECT V.*,1 as DupType FROM csrVendors V ;
>>>INNER JOIN (select MIN(ID) as MinID, UPPER(full_name) as Full_Name FROM csrVendors GROUP BY 2 HAVING COUNT(*) > 1) Dups ;
>>>ON UPPER(V.full_name) = Dups.full_name AND V.ID > Dups.MinID ;
>>>UNION ;
>>>SELECT V.*, 2 as DupType FROM csrVendors V WHERE exists (SELECT full_name FROM i_vendor VV ;
>>>WHERE UPPER(VV.full_name) = UPPER(V.full_name)) ;
>>>INTO CURSOR csrVendorDups NOFILTER
>>>
>>>Do you see what may be wrong here?
>>>
>>>Thanks in advance.
>>
>>I've seen SQL get very confused in UNIONs when you don't explicitly specify your field names.
>
>I'll try, but I think the problem is with the derived table. Most likely I need to move it to a separate cursor.
I would try first changing the alias of the select in the union, you have both alias as V and that might be confusing the parser?
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges