Skip to content
Advertisement

Postgres SQL select query syntax

I have this SQL statement, I am getting a syntax error:

SELECT
  *
FROM
  user_table
  INNER JOIN (
    klass_table
    LEFT JOIN room_table
  )

Syntax error is vague, it says:

You have an error in your SQL syntax; it seems the error is around: ‘)’ at line 8

Perhaps I am missing an ON clause?

Advertisement

Answer

You have not mentioned the columns on which you are doing the inner join.So basically you are missing the “ON” keyword for both the joins.

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