こんにちは、クラスで理解できないSQLクエリを取得しました。助けが得られるのではないかと思っていました。質問は次のとおりです。
「落札者リスト」:落札した会員の一覧とその商品の商品名、商品価格、落札金額を表示します。私のコードは、各メンバーの最高入札額ではなく、それらすべての最高入札額のみを表示しています
そしてテーブル:
Member (username, lastName, firstName, title, address, city, postcode, country,
phoneBH, phoneAH, faxNumber, email, registrationDate, password, isBuyer,
isSeller)
Item (itemNumber, itemName, itemDescription, itemValue, itemLocation,
categoryID, sellerUsername)
Auction (auctionNumber, currency, startDateTime, endDateTime, shippingTerms,
startBidAmount, reserveAmount, bidIncrementAmount, noOfItems, itemSold,
itemNumber feedbackDateAndTime, rating, comments, paymentDate, paymentid)
Bid (bidderUsername, auctionNumber, bidDateTime,bidAmount)
SELECT B.bidderUsername, I.itemName, I.itemValue, B.bidAmount, A.auctionNumber
FROM Item I, Auction A, Bid B
WHERE A.auctionNumber = B.auctionNumber
AND I.itemNumber = A.itemNumber
AND B.bidAmount >= A.reserveAmount
AND A.endDateTime < SYSDATE
AND B.bidAmount = (SELECT max(B.bidAmount)
FROM dbf12.Bid B, dbf12.Auction A
WHERE B.auctionNumber = A.auctionNumber)
コードとテーブルについては、コード/テーブルを選択してプッシュする必要がある場合がありますctrl-k