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-08-19 : 05:37:12
|
| Hello All,I have a query which uses Union.Query is working fine but i want to apply a where clause on the result set which is selection by Query1 Union Query 2.Can any one help me?ThanksSample Query is like thisselect Col1,Col2 from table1Unionselection Col1,Col2 from table2(and I want to apply the where clause on result of above mentioned query) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-19 : 05:38:35
|
| [code]select *from(select Col1,Col2 from table1Unionselect Col1,Col2 from table2)twhere yourconditions[/code] |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-08-19 : 05:42:20
|
[code]select Col1,Col2 from table1where someconditionUnionselection Col1,Col2 from table2where somecondition2[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|