You can use the function second().
It extracts the second portion of a time or timestamp.
So, the query will be something like:
select second(timestamp_column1) - second(timestamp_column2)
Hi,
This (or something similar depending on exact need) should also work:
select interval ('sec', a.kol2 -b.kol2)
from aa a, aa b
where b.kol1 = 1 and a.kol1 = 2
Got it to work using interval: select interval('sec', timestamp('1990-12-12 13:13:13.0')) - interval('sec', timestamp('1990-12-12 13:10:13.0'));
gives the answer 180, as I was looking for.