Skip to content
Advertisement

How to use multiple selects in same query without messing everything

So, i have this query

JavaScript

which outputs this table

enter image description here

then i have this other query

JavaScript

which outputs this:

enter image description here

All i want to do is place the two columns side by side without bugs.

tried this

JavaScript

but it returned this:

enter image description here

Here is the ER diagram:

enter image description here

Advertisement

Answer

Ok, Is hard to follow up the logic with the above information, so I can’t give you the exact query you have to run. But What I can suggest how to arrive to it.

I would recommend to use WITH statement. (https://www.postgresql.org/docs/9.1/queries-with.html)

Sth like:

JavaScript

Then you join with the other query and by nome_equipa and add the column. And that’s it.

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