shashank
shashank

Reputation: 21

left join from a group of tables to another group of tables in postgresql

I have some tables say t1 , t2 , t3. I need to implement something like this in postgresql.

select * from (t1 , t2) left join t3
where t1.some_column = t3.some_column; 

But postgresql complains

ERROR: syntax error at or near "," SQL state: 42601 Character: 77

Upvotes: 1

Views: 59

Answers (1)

Filipe Silva
Filipe Silva

Reputation: 21657

You can't use from (t1,t2), you have to join them in some way.

Try something like this:

select * from t1
inner join t2 on t1.someColumn=t2.someColumn
left join t3 on t1.some_column = t3.some_column;

Upvotes: 1

Related Questions