1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
select cast(col1 as integer)
from tbl1;
select convert(integer, col1)
from tbl1;
select col1::integer
from tbl1;
select cast(col1 as timestamptz)
from tbl1;
select convert(timestamptz, col1)
from tbl1;
select col1::timestamptz
from tbl1;
select cast(col1 as decimal(38, 2))
from tbl1;
select convert(decimal(38, 2), col1)
from tbl1;
select col1::decimal(38, 2)
from tbl1;
select cast(col1 as interval)
from tbl1;
select convert(interval, col1)
from tbl1;
select col1::interval
from tbl1;
select cast(pg_namespace.nspname as information_schema.sql_identifier)
from pg_namespace;
|