Subject | Re: [firebird-support] How to prevent doubled rows in query? |
---|---|
Author | Helen Borrie |
Post date | 2005-06-23T10:03:55Z |
At 09:51 AM 23/06/2005 +0000, you wrote:
course, if you have the same names with different id's, you will get one
row for each combination of name + id. If it is only the names you are
interested and you want to avoid duplicate names, don't include id in the
query.
./heLen
>I have two tables containing NAME and IDs...UNION (without the ALL keyword) should eliminate duplicate rows. Of
>In both table same NAMEs can appear!
>
>I use select query like:
>
>SELECT DISTINCT NAME1 AS NAME,ID AS IDD FROM VOZACI
>UNION
>SELECT DISTINCT NAM2 AS NAME,ID AS IDD FROM UTOVARIVACI
>ORDER BY 1
>
>
>But, if there are same names in both tables I get doubled row in
>result set. Can I prevent rows to be doubled?
course, if you have the same names with different id's, you will get one
row for each combination of name + id. If it is only the names you are
interested and you want to avoid duplicate names, don't include id in the
query.
./heLen