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 |
|
khufiamalik
Posting Yak Master
120 Posts |
Posted - 2008-10-18 : 04:38:51
|
| Hello All,I have been facing a problem regarding UNIOIN.I have a Query which is Selecting Amount from 2 different tables.I want to show these two amounts as 2 different records.So I used UNION operator and it worked finebut there is an amount which is equal in both tablesUNION operator is showing only One Row for these records..Data:Table 1ID Amount1 20Table 2ID Amount1 20Query :Select Amount From Table1UNIONSelect Amount From Table2But it shows only one Row against this Query.Can any one help me????? |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2008-10-18 : 04:54:41
|
| Union eliminates duplicates. It concatenates the two row sets discarding duplicate rows (rows which are identical in the two rowsets)If you want to see both rows, use UNION ALL--Gail ShawSQL Server MVP |
 |
|
|
|
|
|