|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Get the latest records
Hi all,
Im using sybase to keep my records. The details of my table are: ItemID Status Date 1001 Active 02-05-2005 1002 Finished 02-05-2005 1003 KIV 03-05-2005 1001 KIV 04-05-2005 1003 Finished 06-05-2005 Expected Result are: ItemID Status Date 1001 KIV 04-05-2005 1002 Finished 02-05-2005 1003 Finished 06-05-2005 How should i do it? Thanks a lot. |
|
#2
|
||||
|
||||
|
Code:
SELECT * FROM table ORDER BY date DESC GROUP BY ItemID |
|
#3
|
|||
|
|||
|
If i want to get the result from the date range, how should i do it? thanx a lot..
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > Get the latest records |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|