Last updated January 30, 2013. Created by Damien Tournoud on April 16, 2010.
Edited by misjao, rooby, agentrickard, Crell. Log in to edit this page.
Drupal's database layer does not provide cross-database abstraction of SQL functions. For portability across supported database engines your code should only use functions known to be part of the ANSI standard and supported across all databases that Drupal supports. The following is a still-incomplete list. The form used here is recommended as other syntax variants may not work on all databases.
Note that the database layer does not whitelist operators, so you may pass a non-standard function, such as REPLACE(), and it will work for databases that support the syntax.
Type manipulation operators
String functions and operators
SUBSTRING(string, from, length)
SUBSTRING_INDEX(string, delimiter, count)
Mathematical functions and operators