Advertisement
Guest User

Untitled

a guest
May 28th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. -------------------------Selling Function --------------------------
  2. -- SELECT DISTINCT bidder, Buying_Amount(bidder, 1000) as buying_account FROM BidLog
  3. -- ORDER BY buying_account DESC;
  4. SELECT auction_id, status, amount
  5. FROM PRODUCT
  6. WHERE auction_id = 6;
  7.  
  8. --Set to sold 6 (default withdrawm)
  9. UPDATE PRODUCT
  10. SET status = 'sold'
  11. WHERE auction_id = 6;
  12.  
  13. -- -- --Withdraw 6 (default sold)
  14. UPDATE Product
  15. SET status = 'withdrawn'
  16. WHERE auction_id = 6; --Auction they selected
  17.  
  18. -- --Set Prices
  19. UPDATE PRODUCT
  20. SET amount = '500' -- Use query below
  21. WHERE auction_id = 6;
  22.  
  23. -- --Get list of bids for an auction in DESC order (Take the second result unless there is only one)
  24. SELECT amount
  25. FROM BidLog
  26. WHERE auction_id = 6 --Hardcode
  27. ORDER BY amount DESC;
  28. -------------------------Selling Function --------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement