I have a query that is producing something like this:
StartTimestamp | EndTimestamp
================================
100 | 450
--------------------------------
150 | 500
I’d like the result to also include the difference between EndTimestamp and StartTimestamp:
StartTimestamp | EndTimestamp | Difference
==============================================
100 | 450 | 350
----------------------------------------------
150 | 600 | 450
How do I do this in MySQL?
If the table is named, say,
t:Of course, you don’t need the
t.parts in the select’s columns if the undecorated namesStartTimestampandEndTimestampare unambiguous in the context of the rest of your query.