
January 18th, 2013, 05:21 AM
|
 |
SQL Consultant
|
|
Join Date: Feb 2003
Location: Toronto Canada
|
|
Code:
SELECT store_no
, item_no
, date_price_changed
, price
FROM price_history AS t
WHERE ( SELECT COUNT(*)
FROM price_history
WHERE store_no = t.store_no
AND item_no = t.item_no
AND date_price_changed > t.date_price_changed ) < 2
|