Skip to content
Advertisement

Join two tables with no relation postgres?

I have this statement which you can see

I am using Rails and connecting to the database raw, but the output removes duplicate named columns eg user_id etc from the second table and is still giving results in the second table in regards to the first even though there is no relation. Eg

There is no relation between table m and r

I would like A output of something like this

Advertisement

Answer

This is rather exotic way to say UNION ALL

Contrary, ON true will create a cartesian product.

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