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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -