gsc123
Programmer
- Jan 24, 2008
- 197
Hi, I've place this question here because its relavant to this forum.
I need the following query
I use this query to get most of the information, the price is updated in two tables, one bidhistory and the other the products, so I need somewhere in this select query to pull out min bid for users below the proxy bid from the bidhistory
ie
(select min(bidAmount) from bidhistory INNER JOIN products ON products.idproduct = bidhistory.idproduct) as price
but my select to get everything about the item is:
SELECT products.Description, products.Price, products.ImageUrl, products.idproduct, products.endDate, suppliers.idsupplier, suppliers.supplierName FROM suppliers INNER JOIN products ON suppliers.idsupplier = products.idsupplier WHERE idcategory=21 and ListHidden =
false
EG:
is my structure wrong, because bidhistory is only a history of bids not the products price initially laid out, its the start price say £200 ... if theres no bids then the history does'nt have a record so I need the products.price if there is no bids or to show min price from bidhistory...
I then would need that users highest bid from bidhistory so they can see what higher proxy bid they have entered
I hope this is clear.. many thxs in advance
I need the following query
I use this query to get most of the information, the price is updated in two tables, one bidhistory and the other the products, so I need somewhere in this select query to pull out min bid for users below the proxy bid from the bidhistory
ie
(select min(bidAmount) from bidhistory INNER JOIN products ON products.idproduct = bidhistory.idproduct) as price
but my select to get everything about the item is:
SELECT products.Description, products.Price, products.ImageUrl, products.idproduct, products.endDate, suppliers.idsupplier, suppliers.supplierName FROM suppliers INNER JOIN products ON suppliers.idsupplier = products.idsupplier WHERE idcategory=21 and ListHidden =
false
EG:
is my structure wrong, because bidhistory is only a history of bids not the products price initially laid out, its the start price say £200 ... if theres no bids then the history does'nt have a record so I need the products.price if there is no bids or to show min price from bidhistory...
I then would need that users highest bid from bidhistory so they can see what higher proxy bid they have entered
I hope this is clear.. many thxs in advance