2
I am trying to compare 2 timestamp fields, which have different dates, ignoring the dates and using only the hour/minute simultaneously, to know, within a same day which of them is bigger.
EX: '2000-10-10 10:00:22' > '2000-02-02 11:00:10'
In this case the dates would be ignored by comparing only '10:00' > '11:00' and returning FALSE.
I tried to use EXTRACT() but I couldn’t find something like "time"
SQL would be something like that (If the team existed):
SELECT * FROM "Tabela" WHERE EXTRACT(TIME FROM "Coluna_1") > EXTRACT(TIME FROM "Coluna_2")
SELECT * FROM "Tabela" WHERE "Coluna_1"::time > "Coluna_2"::time
works?– rray
Thanks for saying, I didn’t know this way. I wanted something to eliminate the hundredths, but this one should work.
– Lucas_Kunze