Marius Marius - 1 month ago 9
SQL Question

SQL add 2 hour to a column with type "date"

I had a column with dates, in an

Select
statement, and i want to add 2 h to each row in this
Select
.

Any advice?

Answer

I prefer using interval for this:

select deliverydate + interval '2' hour
from the_table;

The above is standard SQL and works well in Oracle.

More details in the manual: https://docs.oracle.com/database/121/SQLRF/sql_elements003.htm#SQLRF00221