Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai,

Is it possible to write a subquery within the COUNT() function?

For Eg:-

I want to get the count of employees.

select COUNT(select userid from users inner join credit on
             users.userid=credit.userid
             union
             select userid  FROM users inner JOIN jobs
             ON users.userid=jobsuserid)
Posted

1 solution

:omg:
Why you need Count() outside, just write query as
select count(userid)...............
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900