doc-exports/docs/dws/dev/dws_06_0311.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

3.7 KiB

date_part

The date_part function is modeled on the traditional Ingres equivalent to the SQL-standard function extract:

1
date_part('field', source)

Note that the field must be a string, rather than a name. The valid field names are the same as those for extract. For details, see EXTRACT.

Example:

1
2
3
4
5
SELECT date_part('day', TIMESTAMP '2001-02-16 20:38:40');
 date_part 
-----------
        16
(1 row)
1
2
3
4
5
SELECT date_part('hour', interval '4 hours 3 minutes');
 date_part 
-----------
         4
(1 row)