Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
hornet
Yak Posting Veteran
96 Posts |
Posted - 2006-11-02 : 04:50:31
|
Hi all!I have to retrieve distinct values for the query which is using UNION.e.g. SELECT DISTINCT(peny) FROM (SELECT DISTINCT(peny) FROM AUNION ALL SELECT DISTINCT(peny) FROM BUNION ALL SELECT DISTINCT(peny) FROM C)How can i do it?thanks in advance! |
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2006-11-02 : 04:53:20
|
Using UNION without the ALL returns distinct values alreadyselect peny from a unionselect peny from b unionselect peny from cDuane. |
 |
|
|
|
|