How to use case statement with select and group by -


select company, case when ((select count() ftmuser active='0' group company)>5) (select count() ftmuser active='0' group company) else '0' end
ftmuser

i want display records having count > 5 above query fails , says error: more 1 row returned subquery used expression sql state: 21000

please guide me on this. thanks.

try this:

select company, case when ((select count(*) ftmuser active='0'                             group company company=ft.company)>5)                      (select count() ftmuser <br>where active='0'                            group company company=ft.company )                      else '0' end ftmuser ft 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -