SELECT DISTINCT

Eric Forget forgete at cafederic.com
Mon Feb 10 12:07:43 CST 2003


> I have 2 tables:
> 
>   A           B
>   ------      -------
>   Name        Name
>   ptr_b
> 
> 
> I want to select all unique B which have at least 1 relation to A, ordered
> by B.Name. So I wrote this;
> 
>   SELECT DISTINCT A.ptr_b, B.Name FROM A, B ORDER BY B.Name
> 
> With that syntax the keyword has no effect: I have duplicates. Is it the
> syntax which is illegal or is it a bug? Is there another way of doing it?

I found it:

SELECT DISTINCT B.RecID, B.Name  FROM A, B ORDER BY B.Name


Éric

___________________________________________________________________

 Eric Forget                       Cafederic
 ForgetE at cafederic.com             <http://www.cafederic.com/>

 Fingerprint <86D5 38F5 E1FD 5D9C 71C3  BAA3 797E 70A4 6210 C684>




More information about the Valentina mailing list