Skip to content
Advertisement

Select from many to many relations table

Given these tables:

scenarios-suites tables

I would like to query scenarios with all the connected suites.

results:

Please direct me to the preferred postgresql select query

Also the relation here is one (scenario) to many (suites) , if the design should be different please advise.

Advertisement

Answer

Use joins and string aggegation:

I made the assumption that table suites has a column called description, which you want to display.

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