YUNG
YUNG

Reputation: 9

How to get the result for the total duration(seconds) for the date for each invoice_no using sql query?

Here is my table

enter image description here

FROM TABLE DURATION

Upvotes: 0

Views: 25

Answers (1)

Caius Jard
Caius Jard

Reputation: 74605

Perhaps

SELECT invoice_no, TIMESTAMPDIFF(SECOND, MIN(date), MAX(date))
FROM duration
GROUP BY invoice_no

Upvotes: 1

Related Questions