Skip to content
Advertisement

How to display rows with no count aggregate result?

I have a table which contains Job, City and PersonName (who works in that city). I want to return all jobs and cities even if there is no one working in that city. This is a simple example :

Creation of the table :

My Query

My result

But I would like to have :

I have no clue how to do this, could you help me please?

Advertisement

Answer

This answers the original version of the question.

Use cross join to generate the rows and then left join:

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