Working without parentheses

You come across the following query when working in PostgreSQL.

SELECT a FROM b UNION SELECT x FROM y LIMIT 10

Which of these choices correctly depicts how this query is evaluated?

Options
  1. It is evaluated as (SELECT a FROM b UNION SELECT x FROM y) LIMIT 10
  2. It is evaluated as SELECT a FROM b UNION (SELECT x FROM y LIMIT 10)
  3. It throws a syntax error
  4. It throws a runtime error

Related Posts

Close Bitnami banner
Bitnami