I am trying to track price changes on a daily basis. I have 2 tables Stores
and Prices
.
Table Stores
columns:
- s_id
- company
- address
- city
- state
- zip
- phone
Table Prices
columns:
- ref
- storeid
- price
- mgr
- datetime
NOTE: storeid in Prices is a reference to s_id in Stores
What I would like to do is run a query to find all prices from yesterday and compare them to today to see if they have changed. Please understand that I am filing in for the database admin for any advice you can offer.
Best Answer
Would be something like:
You can add
Stores
to get store information if you need. I do not know which DB you use so I gave a solution for Oracle. Thetrunc
function gives you the date part of a date.