Hi all,
I have a pgsql database , i want to compare two fields with there timestamp values.
basic query
select t1.valu1, t1.value2 from table1 as t1 where t1.valu1 == t1.valu2
With TimeStamp comparison
select t1.valu1, t1.value2 from table1 as t1 where EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE t1.valu1 ) == EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE t1.valu2 )
the sample values of valu1 is "14:50:15"
, "10:50:15"
and valu2 "11:10:15"
, "17:50:15"
I want to convert the valu1 and valu2 to timestamps and after that compare two timestamps
// syntax of extract
EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '20:38:18');
I Got Error in the following format
EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE t1.valu2 )