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 |
angarakiran777
Starting Member
3 Posts |
Posted - 2015-01-13 : 23:58:11
|
Hi,How to get the lowest U.Price along with FX and Rate.ID-U.Price-FX-Rate1280 19.1196 EUR 3.851280 46.2462 USD 3.631280 6.32 RM 1.00Required output.ID-U.Price-FX-Rate1280 6.32 RM 1.00 |
|
nagino
Yak Posting Veteran
75 Posts |
Posted - 2015-01-14 : 00:54:11
|
SELECT TOP 1ID, [U.Price], FX, RateFROM YourTableORDER BY [U.Price] ASC-------------------------------------From JapanSorry, my English ability is limited. |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2015-01-14 : 02:11:38
|
SELECT * FROM ( SELECT ID, [U.Price], FX, Rate, ROW_NUMBER() OVER(PARTITION BY ID ORDER BY [U.Price] ASC ) RowNumFROM YourTable) TempWHERE RowNum=1--Chandu |
|
|
|
|
|