logo

Palette - Make it Colorful🎨

Palette - Visual Page Builder, no design degree required.

Live Demo Download Palette

Scroll
12/04/2025, by Ivan

The Drupal database layer does not provide cross-database abstraction for SQL functions. To ensure portability across supported database engines, your code should use only those functions that are known to be part of the ANSI standard and supported in all databases supported by Drupal. The following is still an incomplete list. The form used here is recommended, as other syntax variants may not work across all databases.

Note that the database layer does not whitelist operators, so you can pass a non-standard function like REPLACE(), and it will work for databases that support the syntax.

Logical Operators

  • AND
  • OR
  • NOT

Comparison Operators

  • <
  • >
  • <=
  • >=
  • <>
  • LIKE

String Functions and Operators

  • CONCAT(string1, string2)
  • SUBSTRING(string, from, length)
  • SUBSTRING_INDEX(string, delimiter, count)
  • LENGTH(string)

Mathematical Functions and Operators

  • GREATEST(num1, num2)
  • POW(num1, num2)
  • LOG(base, value)

Aggregate Functions

  • COUNT(expression)
  • SUM(expression)
  • AVG(expression)
  • MIN(expression)
  • MAX(expression)