Thursday 15 September 2011

sql - Finding previous records after specified one and joining them -


We have this table, where players' actions are being recorded. I want to know where people buy their equipment ( item bo or sword) can be purchased at the shop or auction (in the action column) ) Therefore, when the player purchases an item, we will have to search for the verb {/ code> shop or auction (depending on what the item was bought before one of them was purchased) < / P>

  ** User Time Action Item ** 1 12:00 Auction 2 12:01 Shop 3 12:04 Shop 4 12:09 Shop 4 12:15 Bow 2 Buy Auction 2 12:19 Auction 1 12:25 Chat 4 12:33 33 Auction 3 12:47 Chat 1 12:47 Buy Swords 2 12:47 Bow 3 Buy 12:50 Sword 4 Buy 12:52 Bow 3 Buy 12:56 Bow Bought   

Result

 

No comments:

Post a Comment