|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, Can sombdy please help me..
I have a table uid status date_updated 3 45 09/23/2003 4 67 08/10/2004 * 4 67 09/12/2004 5 90 11/10/2003 6 34 06/10/2004 7 56 09/03/2003 * 7 56 11/09/2004 9 56 08/23/2004 ... I want distinct status in same uid's with latest date_updated. The o/p should be like: uid status date_updated 3 45 09/23/2003 4 67 09/12/2004 5 90 11/10/2003 6 34 06/10/2004 7 56 11/09/2004 9 56 08/23/2004 ... I'm trying my best. Can sombdy please help me? Thanks in advance.. |
|
#2
|
|||
|
|||
|
Try this:
SELECT uid, status, date_updated FROM yourTable a WHERE (date_updated = (SELECT MAX(date_updated) FROM yourTable b WHERE a.uid = b.uid )) Note: yourTable = the same table. This should work or at least get you on the right path. Please repost whether or not this works for you. |
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > SQL query problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|