PostgreSQL SELECT statement syntax If you specify a list of columns, you need to place a comma ( , ) between two columns to separate them. If you want to select data from all the columns of the table, you can use an asterisk ( * ) shorthand instead of specifying all the column names.
PostgreSQL MIN() function is an aggregate function that returns the minimum value in a set of values. Syntax: MIN(expression); The MIN() function can be used with SELECT, WHERE and HAVING clause.
PostgreSQL UNNEST() function This function is used to expand an array to a set of rows.
The nullif() function returns a null value, if a the value of the field/column defined by the first parameter equals that of the second. Otherwise, it will return the original value.
LEAST(a, b):
The
GREATEST
andLEAST
functions select the largest or smallest value from a list of any number of expressions. The expressions must all be convertible to a common data type, which will be the type of the result (see Section 10.5 for details). NULL values in the list are ignored. The result will be NULL only if all the expressions evaluate to NULL.Note that
GREATEST
andLEAST
are not in the SQL standard, but are a common extension. Some other databases make them return NULL if any argument is NULL, rather than only when all are NULL...
Here's the link to docs for the LEAST()
function in PostgreSQL:
http://www.postgresql.org/docs/current/static/functions-conditional.html#AEN15582
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With