SQL subquery with COUNT help -


i have sql statement works

select * eventstable columnname='business' 

i want add subquery...

count(business) row_count 

how do this?

this easiest way, not prettiest though:

select *,     (select count(*) eventstable columnname = 'business') rowcount     eventstable     columnname = 'business' 

this work without having use group by

select *, count(*) on () rowcount     eventstables     columnname = 'business' 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -