Skip to content
Advertisement

Can’t use HAVING clause properly in SQL

I’m having problem with my SQL query.

This is my first post, so i’m sorry if the layout isn’t appropriate. I have to filter the grouped results. If there is at least one employee with “MAN” job_id in each row(group in this instance) then the row must be displayed, if there is none, then the whole row(group) shouldn’t be displayed at all. it needs to be done with HAVING clause i suppose, but i always get errors… anyone who could help, please?

Image of Result The Code Image

Advertisement

Answer

If there is at least one employee with “MAN” job_id in each row(group in this instance) then the row must be displayed,

You can use:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement