Re: Portable SQL to compute a date difference in seconds???



On 11 mei, 18:39, Gene Wirchenko <g...@xxxxxxxx> wrote:
You could use the datetime type. The difference between two
datetime values is in seconds, as in:
datetime1-datetime2

This subtraction returns a value of type 'interval'. Getting the
duration of an interval in seconds isn't standard either

On 11 mei, 18:39, Gene Wirchenko <g...@xxxxxxxx> wrote:
This could turn into the DBMS equivalent of programming "100
Bottles of Beer" in various programming languages.

On 11 mei, 16:42, Gints Plivna <gints.pli...@xxxxxxxxx> wrote:
Time to understand that even if these products all are called DBMSes
it doesn't mean all are the same or even similar.

Understood... and confirms my suspicion - no general solution possible
even for something as simple, common and basic as subtracting 2
dates...
The level of standardisation in SQL is below what I expected. :-(

An variation on the comment from Gints:
Time for the DBMS vendors to understand that their lack of
standardisation is costing people a lot of time and effort.


Johan

.


Quantcast