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

Combine 2 SQL Query's to One DataSet

$
0
0

I am running these two query's they each work fine independently.  Now I need to combine them so that they are in one dataset.

The only stipulation of combining them is the 1st query, I only need a total count whereas the second query I need it to show a breakdown of each answer and a count.

--Query 1
Select count(distinct(a.login_id) As [loginCount],
b.Name, a.answer
From dbo.tbl_f b
Inner Join tbl_r a
ON a.login_id = b.login_id
Where b.name = 'employeeanswer' and a.answer in ('Yes', 'No', 'Possibly')
Group By b.name, a.answer

--Query 2
Select count(distinct(a.login_ID) As [logincount], b.name, a.answer
From dbo.tbl_f b
Inner Join tbl_r a
On a.login_id = b.login_ID
Where b.name = 'employeeAnswer'
And a.answer IN ('No Way', 'Not a chance')
Group by b.name, a.answer
Order By a.answer Asc


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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