Oracleism: Don't use AS for table aliases

Last updated on
8 September 2016

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

In both MySQL and PostgreSQL, when giving tables aliases in the FROM clause, it is optional to use the AS keyword.

SELECT n.nid, u.uid, u.name FROM {node} AS n LEFT JOIN {user} AS u ON n.uid = u.uid;

However, the Oracle database does not allow AS to be use in FROM or any JOINs.

SELECT n.nid, u.uid, u.name FROM {node} n LEFT JOIN {user} u ON n.uid = u.uid;

Unfortunately, this makes finding the right alias for a table rather difficult.

Help improve this page

Page status: No known problems

You can: