How to calculate change in ANSI SQL
- by morpheous
I have a table that contains sales data. The data is stored in a table that looks like this:
CREATE table sales_data (
sales_time timestamp
, sales_amt double
)
I need to write parameterized queries that will allow me to do the following:
Return the change in sales_amt between times t2 and t1, where t2 and t1 are separated by a time…