Functions

Set functions

count
select count (*) from table-name;
select count (column1, column2, ...) from table-name;
min, max
select max (column-name) from table-name;
select min (column-name) from table-name;
sum, avg
select sum (column-name) from table-name;
select avg (column-name) from table-name;

String functions

upper, lower
upper ( 'text' )
lower ( 'text' )
trim
  • Default: blank spaces
trim ( leading from '   text' )
trim ( trailing from 'text ' )
trim ( both from ' text ' )

trim ( both '.' from '...text...' )

Numeric functions

position
position ( 'bc' in 'abc' )
Length
-- Number of characters,
character_length
-- Number of bytes
octet_length
-- Number of bits
bit_length
extract
extract ( month from date '2002-01-31' )

Datetime functions

current_date
current_time ( fractional-seconds-precision )
current_timestamp ( fractional-seconds-precision )