Då webbhotellet inte hade mySQL 4.1 blev jag tvungen att hantera temporära tabeller.
' Skapar temporära tabeller innhållande maxbudet för varje auktionsobjekt '
RunNonQuery("DROP TABLE IF EXISTS tmp3")
RunNonQuery("CREATE TABLE tmp3 (maxbid int(11), aoid int(11));")
' Här lägger vi in värderna
RunNonQuery("INSERT INTO tmp3 SELECT MAX(t1.bid), t1.auctionobjectid " & _
"FROM bidding t1, auctionobjects t2 WHERE t1.auctionobjectid = t2.id AND t2.auctionid = " & auctionID & " GROUP BY 2;")
Tabellerna som används är auctionobjects samt bidding.
I den temporära tabellen vill jag lägga in samtliga id ur tabellen auctionobjects (där auctionid = specifikt värde).
Bidding
id | auctionobjectid | bid
auctionobject
id | auctionid
Det fungerar nu men endast de auctionobjectid som har ett bud kopplat till sig läggs in i den temporära tabellen.
Jag vill ha in alla id som följer auctionid = specifikt värde.