document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. select id, b1.auction_id, created
  2. from bid b1
  3. join (
  4.     select auction_id, max(created) as ts from bid
  5.     where user_id=20 group by auction_id
  6. ) b2
  7. on b1.auction_id=b2.auction_id and b1.created=b2.ts
');