SELECT DISTINCT

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Feb 10 19:14:16 CST 2003


on 2/10/03 6:53 PM, Eric Forget at forgete at cafederic.com wrote:

> Hi,
> 
> 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?

Hard to say.

Try other way:

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

This is form of link distinct.

The first query it seems correct.
What exactly duplicates you get?
DISTINCT here remove duplicates not of NAME, but pair { ptr, NAME }.


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list