I have some data in a table that looks something like this:
Item date price
A 8/29/2012 $ 3
B 8/29/2012 $ 23
From 8/29/2012 $ 10
A 8/30/2012 $ 4
B 8/30/2012 $ 25
From 8/30/2012 $ 11
A 8/31/2012 $ 3
B 8/31/2012 $ 22
From 8/31/2012 $ 8
A 01/01/2012 $ 3
B 01/01/2012 $ 26
C 01/01/2012 $ 9
A 02/02/2012 $ 3
B 02/02/2012 $ 24
C 02/02/2012 $ 9
I need to write a query that identifies that the price for A has not changed since 08/30/2012, the price for item C has not changed since 01/09/2012, and return the number of days that have passed for both (we are looking for items with non-moving prices). I cannot use CTE, or cursors, or separately created temporary tables (select, etc.) due to the limitations of the web report tool that sql must execute. I can only use the "basic" request for selecting a single pass (subqueries will work, though). Does anyone have any clever ideas on how to achieve this?
, Item Price, ,
, having count > 2,
.
,
. , .