Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

same where condition for union all query

$
0
0

Hi, 

Here i am going to fetch same column name from 3diff tables with same where condition. Is any other way to write the below code.

set @datas 
=(select ACCOUNT,FACILITY,VERSION,TIMEID,SIGNEDDATA 
from dbo.tblFAC2PLANNING 
union all select ACCOUNT,FACILITY,VERSION,TIMEID,SIGNEDDATA 
from dbo.tblFACTPLANNING 
union all
select ACCOUNT,FACILITY,VERSION,TIMEID,SIGNEDDATA 
from dbo.tblFACTWBPLANNING) where version='Actual' and facility='FA_00'


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>