
August 6th, 2005, 04:25 AM
|
|
Registered User
|
|
Join Date: Jan 2005
Posts: 4
Time spent in forums: 31 m 37 sec
Reputation Power: 0
|
|
max(id) + Join Statement
in my SQL query following is the code to list out the users who have reached city MUM at last which is working properly. but if i want to know the details of that particular user from the Usermaster .... how do i do that
select userid,citycode,time
from progress as aa
where userid.id=
(select max(id) from progress as bb where aa.userid=bb.userid)
and aa.citycode='MUM'
***********************************
Fields in User Master are:
userid,USername,AgeAddress
fields in the tracking table is
userid,citycode,time
Thanx in Advance
|