Introducing SQL for CRM Analytics

SQL for CRM Analytics is a query language that lets you execute queries against your CRM Analytics datasets. SQL (Structured Query Language) is typically used for working with data stored in relational databases—you might already be familiar with variants like MySQL and PostGreSQL. CRM Analytics uses the ANSI SQL interface to access CRM Analytics’s fast in-memory data store. It has native support of Salesforce features used in CRM Analytics, including sharing inheritance and custom fiscal calendars.

SQL for CRM Analytics supports these standard SQL features.

  • SELECT Clause
  • FROM Clause
  • WHERE Clause
  • GROUP BY Clause
  • GROUP BY ROLLUP
  • GROUPING()
  • HAVING Clause
  • ORDER BY Clause
  • LIKE Clause
  • LIMIT Clause
  • FETCH Clause
  • OFFSET Clause
  • CASE statements
  • COALESCE()
  • NULLIF()
  • UNION Operator
  • Aggregate, windowing, math, and string functions
  • Subqueries

These features don’t support the full range of cases covered by ANSI SQL. Refer to each statement in the SQL for CRM Analytics reference for more information.