msaunders26
New member
- Local time
- Today, 01:39
- Joined
- Feb 20, 2008
- Messages
- 8
Hi everyone,
I have three tables, set up like this,
Auctions:
Auction ID, Winner ID # (a Customer ID, as shown below), Price
Bids:
Auction ID, Customer ID, Price
Customers:
Customer ID, Name
I need to find a query that does this functionality:
For each auction (entry in the Auctions table), if Bob didn't win the auction (Auctions.WinnerID =! Bob), but Bob has made a bid (For that auction, Bob is in the Bids table), show the difference between the Winner's price and Bob's price (Auctions.Price - Bob's price for that auction as shown in the Bids table)
I suppose the output table would look something like:
Auction ID, Winner's Price, Bob's Bid Price, Difference Between the two
I hope this is clear. Your help is greatly appreciated. THANKS!
I have three tables, set up like this,
Auctions:
Auction ID, Winner ID # (a Customer ID, as shown below), Price
Bids:
Auction ID, Customer ID, Price
Customers:
Customer ID, Name
I need to find a query that does this functionality:
For each auction (entry in the Auctions table), if Bob didn't win the auction (Auctions.WinnerID =! Bob), but Bob has made a bid (For that auction, Bob is in the Bids table), show the difference between the Winner's price and Bob's price (Auctions.Price - Bob's price for that auction as shown in the Bids table)
I suppose the output table would look something like:
Auction ID, Winner's Price, Bob's Bid Price, Difference Between the two
I hope this is clear. Your help is greatly appreciated. THANKS!