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 |
sunny_10
Yak Posting Veteran
72 Posts |
Posted - 2012-12-19 : 09:51:39
|
Hi I have 2 tables having field month . I want to display distinct months from the 2 tables Table1 Table2 11 11 12 12 1 1 2So the query should return 11,12,1,2 Thanks |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-12-19 : 09:55:39
|
[code]SELECT [month] FROM Table1 UNION SELECT [month] FROM Table2;[/code] |
|
|
sunny_10
Yak Posting Veteran
72 Posts |
Posted - 2012-12-19 : 10:00:42
|
Hi I don't need to use distinct keywordThanks |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-12-19 : 10:04:15
|
where's distinct used in given suggestion?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|