Subject | How to prevent doubled rows in query? |
---|---|
Author | matijamikac |
Post date | 2005-06-23T09:51:06Z |
I have two tables containing NAME and IDs...
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?
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?