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
Post a Comment