Hello,
Similar to my last post I have another SQL problem. If you are running
an auction and you have the following fields;
lot_no
bidder_no
bid
bid_time
bid_date
How do you write an SQL for this if you want ONLY the highest bid
entered at the earliest date and time with the bidder number. I can get
it without the bidder number, but as soon as I add it in I get all the
records again. How do you filter out the ones you do not want. Here
is the code I have that works without the bidder number;
SELECT Min(bid_date) AS MinOfbid_date, Min(bid_time) AS MinOfbid_time,
lot_no, Max(bid) AS MaxOfbid
FROM bids
GROUP BY lot_no;
When I add the bidder number like this;
SELECT Min(bid_date) AS MinOfbid_date, Min(bid_time) AS MinOfbid_time,
lot_no, Max(bid) AS MaxOfbid, bidder_id
FROM bids
GROUP BY lot_no, bidder_id;
I get all the records again. The final output should be a five column
table - date, time, lot, bid, bidder.
Any assistance is greatly appreciated.
worldbadger