I've the below column,
and I'd like to get the date in yyyy-mm-dd
format from the time_usec
column.
Any guidance is appreciated!
CodePudding user response:
Use below
select time_usec, date(timestamp_micros(time_usec)) date
from your_table
CodePudding user response:
One possible solution would be the following:
SELECT
TIMESTAMP_ADD(TIMESTAMP "1970-01-01 00:00:00 00",
INTERVAL 1635500264544000 MICROSECOND) AS t1;
Here we use the TIMESTAMP_ADD
function to add the microseconds value to the base epoch.