CAST
Converts a value from one type to another: text to a number, text to a date, a number to text.
Syntax
CAST(<value> AS <type>)
<value>::<type>
The ::<type> form does the same and is shorter, but it exists only in PostgreSQL. You need it when data arrives as text or when a type gets in the way of a calculation.