// referência gratuita

SQL function reference

601 functions in 8 categories. Each page has the syntax, examples, the edge cases where engines disagree, and a support table for SQL Server, PostgreSQL, MySQL, SQLite and Oracle that names the stand-in when an engine spells the function differently.

Aggregates

52 functions

One answer per group: counts, sums, percentiles and the ordering-aware cousins.

Strings

172 functions

Concatenate, cut, pad, search and regex-replace text.

Dates & times

121 functions

Build, break apart, truncate and measure timestamps.

Math

82 functions

Rounding, remainders, powers and randomness.

Condicional

43 functions

NULL handling and branching inside a single query.

Janela

79 functions

Rank, navigate and compare across rows without collapsing them.

Conversion

39 functions

Cast values between types, safely or not.

System & session

13 functions

Current user, database and session, last inserted ID, rows affected and other metadata.

SQL functions FAQ

Which databases does this reference cover?

SQL Server, PostgreSQL, MySQL, SQLite and Oracle. Every function page marks which of the five support the function, which use a different name for it, and which have no equivalent.

What do the engine support marks mean?

A filled green dot means the engine has the function under that name. A half-filled amber dot means the capability exists under another name or with different syntax, such as GROUP_CONCAT for STRING_AGG. A hollow grey ring means the engine has no built-in, and the note says what to use instead. Version requirements, such as SQL Server 2022 or SQLite 3.44, are in the notes.

Why do databases disagree about simple functions?

The SQL standard only fixes some functions. The rest grew separately, so the same idea arrived as STRING_AGG, GROUP_CONCAT and LISTAGG, and NULL or collation rules differ per vendor. The pages call out the differences and give the portable form where one exists.

Can I run the examples as they are?

Expressions on literals, such as SELECT ROUND(2.5), run as shown; the expected result is in a trailing comment. Queries against tables like orders and users need your own table and column names. Examples labelled Any engine use syntax all five accept; Oracle before 23ai needs FROM dual on a SELECT without a table. Engine-labelled examples show the dialect that differs.

// built-ins per engine

The right function, before you finish typing

SQLly's editor knows the built-in functions of each engine. Completion offers the ones your connection's dialect has, hover cards explain them, and signature help shows each argument as you type. On macOS, Windows and Linux.