Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

how to add another column to a query result

$
0
0

Hello,

I have two queries that I make a union all, to this I would add a column that makes me from another query. I tried as below and in other ways but without success

SELECT Name,

(
SELECT Date1,Date2,Comment,State         
FROM   tblHystory 
WHERE  IDHistory=976
UNION ALL 
SELECT Date1,Date2,Comment,State         
FROM   tblArchHystory 
WHERE  IDHistory=976
)

FROM tblName



Thanks :)


www.Photoballot.net


Viewing all articles
Browse latest Browse all 8428

Trending Articles



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