(no subject)

Feb 17, 2009 14:57

OH, mighty SQL gurus on my flist..... So, I've got this table that records rental transactions. It has the TransactionDate, ItemID for the item, and the Action (Rented or Returned). For entries that are Rented, it also has CustomerID for the person who rented it. What it does NOT have is the CustomerID for the Return entries. I'm trying to figure out a way to say "For this customer, show me everything Rented and when it was Returned". Basically, every Rented entry that has this CustomerID, and the next following Returned entry for that ItemID. It's making my brain hurty - any ideas?
Up