Click here to Skip to main content
15,895,832 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to perform a count function on a column of a table where i have also performed multiples joins with other tables.
The problem i'm facing is that the count was performed on the result of the complete joins where in my case i want it to performed on that particular table.How should i solved this
Posted

Just return additional values in your query.
I dont think this is the best way from a performance perspective, but it should work.

select *, (select count(*) from tab1) from tab1, tab2, tab3 where tab1.a = tab2.a and.......
 
Share this answer
 
You could use a completely separate select statement for it.
 
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