Skip to content
Advertisement

JOIN multiple tables based on one reference table and count records

I have these following tables:

cars:

type:

color:

desired table:

How could I get the resulting table? I would prefer not to use the with clause. Would a CROSS JOIN be the optimal way?

Advertisement

Answer

It seems it could be done with 2 LEFT JOINs and COUNT DISTINCT aggregate functions. Something like this

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