i have a column of data type 'Interval day to second(25)' which is having sample value
'0 00:04:41.470157' from this i just want to extract 'day' .
could you please help me how can i achieve this
dbadmin=> SELECT extract(day from '0 00:04:41.470157'::interval day to second) AS day;
Do you mean this?
WITH input(intv) AS (
SELECT INTERVAL '0 00:04:41.470157'
UNION ALL SELECT INTERVAL '1 00:04:41.470157'
UNION ALL SELECT INTERVAL '2 00:04:41.470157'
, DAY(intv) AS day_extracted
00:04:41.470157 | 0
1 00:04:41.470157| 1
2 00:04:41.470157| 2
Happy playing, and good luck
Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.