Aliasing a subquery in FROM
PostgreSQL requires a sub-SELECT surrounded by parentheses, and an alias must be provided for it. The alias is not mandatory for Oracle.
This assertion was true before PostgreSQL 16. A patch change this behavior, making aliasing an option to subqueries.
Patch: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=bcedd8f5fce0b69970cf0cee7bca560833d05869
Source: https://pganalyze.com/blog/5mins-postgres-waiting-for-postgres-16-subquery-alias-optional
A query for Oracle:
SELECT * FROM (SELECT * FROM table_a)
Should be rewritten:
SELECT * FROM (SELECT * FROM table_a) AS foo
Edited by Florent Jardin