Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ilans11il
Starting Member
2 Posts |
Posted - 2015-04-10 : 09:52:51
|
Hifrom the below table I'd like to select the 3 top Price valuesProductID ProductName SupplierID CategoryID Unit Price1 Chais 1 10 boxes x 20 bags 18 2 Chang 1 24 - 12 oz bottles 19 3 Syrup 2 12 - 550 ml bottles 10 4 Anton 2 48 - 6 oz jars 22 5 Chef 2 36 boxes 21.35 6 Grandma 2 12 - 8 oz jars 25 ----------------------------------I'd like to get:Price252221.35Thanks in Advanced |
|
MichaelJSQL
Constraint Violating Yak Guru
252 Posts |
Posted - 2015-04-10 : 09:55:49
|
SELECT TOP 3 * FROM Table Order by [Unit Price] DESC- something like this? |
|
|
jcb267
Constraint Violating Yak Guru
291 Posts |
Posted - 2015-04-10 : 10:12:55
|
select top 3 *from [Your Table]order by [Cost Field] desc |
|
|
jcb267
Constraint Violating Yak Guru
291 Posts |
Posted - 2015-04-10 : 10:13:55
|
Is it 3 records or 5 you want?If 5 change the 3 to a 5 above...... |
|
|
ilans11il
Starting Member
2 Posts |
Posted - 2015-04-10 : 10:57:51
|
Thank u very much |
|
|
|
|
|