How do you count the rows in a SQL query which already used count, group by, and having before? -


for example, using answer question:

how select users made more 10 submissions "how select users made more 10 submissions."

select userid submission    group userid having count(submissionguid) > 10 

let's want know many rows sql statement outputted. how scalable solution counting rows of counting rows?

slight error in posted example, need alias table name subquery:

 select count(*)   (select userid    submission     group userid    having count(submissionguid) > 10) t 

i'm not sure scalability, solution. if isn't scaling enough you, need consider major design changes, perhaps tracking submitted more 10 submissions in separate table update through applications populate submissions. or many other possible solutions.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -