Track price changes on a daily basis
Would be something like:

select  p1.ref, p1.storeid, p1.price, p2.price
from    prices p1 
join prices p2 on p1.ref = p2.ref
where   trunc(p1.datetime) = trunc(sysdate)
and     trunc(p2.datetime) = trunc(sysdate-1)
and     p1.price &lt;&gt; p2.price;


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. The trunc function gives you the date part of a date.