SQL count without wrapping query -


i have following hypothetical code , works getting number of rows of site

select count(*) (     select site       (select...) x  left join foo.bars          on foo.id = x.id   group site ) 

is there other way count without using outer select?

you can want count(distinct):

select count(distinct site) (select...) x left join      foo.bars       on foo.id = x.id; 

the 1 difference original version count null value of site. if important, query can modified take account.


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -