In PostgreSQL, the GREATEST()
function returns the greatest (or largest) value from a list of any number of expressions.
The GREATEST()
function is not included in the SQL standard, but it’s a popular extension that many major RDBMSs support.
Database Management Systems
In PostgreSQL, the GREATEST()
function returns the greatest (or largest) value from a list of any number of expressions.
The GREATEST()
function is not included in the SQL standard, but it’s a popular extension that many major RDBMSs support.
Most major RDBMSs support the NULLIF()
operator, which returns NULL
if both of its arguments are equivalent. If the arguments not equivalent, NULLIF()
returns the first argument.
NULLIF()
is a SQL-standard feature (it’s included in the ISO/IEC 9075 specification).
Most major RDBMSs support the COALESCE()
operator, which returns the first non-null value from its list of arguments.
COALESCE()
is a SQL-standard feature (it’s included in the ISO/IEC 9075 specification).
In PostgreSQL, the LEAST()
function returns the smallest value from a list of any number of expressions.
The LEAST()
function is not included in the SQL standard, but it’s a popular extension that many major RDBMSs support.
Here are some options for deleting duplicate rows from a table in Oracle Database when those rows have a primary key or unique identifier column.
In such cases, the primary key must be ignored when comparing duplicate rows (due to the fact that primary keys hold unique values).
Continue readingSometimes you might need to search a database table for only those rows that contain at least one number in a given column.
Technically, numbers can be represented by words and other symbols, but here “number” means “numerical digit”.
Below are examples of how to find rows that contain at least one number in various SQL based DBMSs.
Continue readingIn MariaDB, the NULLIF()
function returns NULL
if both of its arguments are equivalent. Otherwise it returns the first argument.
In PostgreSQL, we can use the to_timestamp()
function to convert a Unix timestamp value to a date/time value.
The Unix timestamp (also known as Unix Epoch time, Unix time, or POSIX time) is the number of seconds that have elapsed since 00:00:00 Thursday, 1 January 1970, Coordinated Universal Time (UTC).
Continue readingHere are four options for returning rows that contain uppercase characters in MariaDB.
Continue readingBelow are two options for returning rows that only contain non-alphanumeric characters in PostgreSQL.
Non-alphanumeric characters include punctuation characters like !@#&()–[{}]:;',?/*
and symbols like `~$^+=<>“
, as well as whitespace characters like the space or tab characters.