I have 2 select statements below which I would like to show the output like below. Currently, I am unable to join first query with second.
fanme lname JobTitle AcceptanceRate
Jim Cary Manager 0.666666
select fname, lname, JobTitle
from [User]
where userID=8
Select convert(decimal, x.QuoteAccepted) / y.AllQuotes as AcceptanceRate
from (
select count(*) as QuoteAccepted
from Quote
where ProjectManager_UserID=8 and QuoteStatusID=6
) x
join (
select count(*) as AllQuotes
from Quote
where ProjectManager_UserID=8
)
y on 1=1
I tried creating temp tables and insert into but it kept showing error:
Column name or number of supplied values does not match table definition.
is there any possible way to do this?