I have a table that stores items with two properties. Thus, the table has three columns:
item_id | property_1 | property_2 | insert_time 1 | 10 | 100 | 2012-08-24 00:00:01 1 | 11 | 100 | 2012-08-24 00:00:02 1 | 11 | 101 | 2012-08-24 00:00:03 2 | 20 | 200 | 2012-08-24 00:00:04 2 | 20 | 201 | 2012-08-24 00:00:05 2 | 20 | 200 | 2012-08-24 00:00:06
That is, every time a property of any element changes, a new line is inserted. There is also a column storing insert time. Now I want to get the number of changes in property_2 . For the table above, I should get
item_id | changes_in_property_2 1 | 2 2 | 3
How can i get this?
source share