|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
SQL statement: finding highes, Distinct value
Hello, Im trying to create a query that selects the highest Unique value. I have come up with the following statement but it obviously selects all Unique numbers and displays them. Im looking to just display the highest. I tried adding Max(BidAmount) but it keeps giving me an aggregate function error.
Select Distinct BidAmount from TblAuction where BidConfirm = 'True' AND ProdCode = 23 ORDER BY BidAmount DESC any input would be great! JH |
|
#2
|
|||
|
|||
|
Select TOP 10 Distinct BidAmount from TblAuction where BidConfirm = 'True' AND ProdCode = 23 ORDER BY BidAmount DESC
Bob@lyrex.com |
|
#3
|
||||
|
||||
|
To get the highest bid based on the given criteria, just do this
Code:
Select MAX(BidAmount) As 'MaxBid' FROM TblAuction WHERE BidConfirm = 'True' AND ProdCode = 23 |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > SQL statement: finding highes, Distinct value |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|