Calculating difference between two. To get the current timestamp as an instance of DATE, use the SYSDATE SQL function. Judging from your output it looks like you have defined START_DATE as a timestamp. TIMESTAMP extends DATE by fractional seconds.
Using BETWEEN with DATETIMEs in SQL Expert Rudy Limeback is asked if SQL can be used to retrieve data between two dates, including the two dates. Beyond the fractional seconds, the timestamp datatype is pretty much analogous to the date datatype. It’s a seven byte store of century, year, month, day and hour, minute and second. In the sample data you provide there is no interval that contains today at 5am.
Timestamp between two times. It has two rows and I need the difference in seconds between these two attributes. The below query is returning negative value and incorrect value. If the dates are really timestamps, then this is easy - subtract them and the result is a day to second interval. These are already in hour:minute:second format!
If the values are dates, subtracting them yields a number. Extract only works on datetimes or intervals. The optional fmt specifies the format of char.
In addition, it stores the fractional seconds, which is not stored by the DATE data type. An Oracle DATE has a day and a time component.