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 |
|
imrul
Starting Member
36 Posts |
Posted - 2011-04-05 : 00:48:52
|
| I want to retrive the last wage with 0 valueTable:id wage date-----------------------------------1 15 01.01.20111 0 08.01.20111 0 15.01.20111 23 22.01.20112 0 01.01.20112 0 08.01.20112 12 22.01.2011My output will be likeid wage date-----------------------------------1 0 15.01.20112 0 22.01.2011Can anyone help? |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2011-04-05 : 01:10:17
|
hi,your output is somehow not related to your data in your table; or am I reading this wrong? hence it's hard to understand how you get this. in your output how do you differ between those two records?anyways, try something like:selectid,wage,max(date)from Table_wagewherewage = 0group by id, wage |
 |
|
|
imrul
Starting Member
36 Posts |
Posted - 2011-04-05 : 06:16:16
|
| Thanks Slimt |
 |
|
|
|
|
|