I have one table called Orders
PurchaseID VARCHAR
purchaseDate DATETIME
purchasePrice FLOAT
I want to find the difference between the purchase price on one day versus another day – The puyrchaseID will be the same.(This is just an example table of course)
SELECT a.purchasePrice AS purchasePriceDay1 , b.purchasePrice AS purchasePriceDay1
from Orders a , Orders b
where a.PurchaseID = b.PurchaseID
Would that actually work
Fill in the placeholders with the ID and dates to compare.
Consult your DBMS documentation to see if you have the math absolute function.