Hi MJ,
If I understand well, you want to compute the difference between
two timestamps in different rows? First of all, subtraction of two dates
will give you a result in seconds, and for subsequent rows look at
lag() over (), for instance. It will avoid a self join.
Stéphane Faroult
On 14/02/16 12:25, MJ Chicago wrote:
I am asking two questions here:
a) compute timediff without having to join table onto itself
b) any additional recommendation to generally improve query performance