Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------Selling Function --------------------------
- -- SELECT DISTINCT bidder, Buying_Amount(bidder, 1000) as buying_account FROM BidLog
- -- ORDER BY buying_account DESC;
- SELECT auction_id, status, amount
- FROM PRODUCT
- WHERE auction_id = 6;
- --Set to sold 6 (default withdrawm)
- UPDATE PRODUCT
- SET status = 'sold'
- WHERE auction_id = 6;
- -- -- --Withdraw 6 (default sold)
- UPDATE Product
- SET status = 'withdrawn'
- WHERE auction_id = 6; --Auction they selected
- -- --Set Prices
- UPDATE PRODUCT
- SET amount = '500' -- Use query below
- WHERE auction_id = 6;
- -- --Get list of bids for an auction in DESC order (Take the second result unless there is only one)
- SELECT amount
- FROM BidLog
- WHERE auction_id = 6 --Hardcode
- ORDER BY amount DESC;
- -------------------------Selling Function --------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement