Hi Chuck, Now I understand what's your question, but example you provided was not very clear (but almost, :-))
Try the following one, and I don't have time to check the efficiency: SELECT a.id, a.tapeid, a.timeStamp FROM yourTable a, (SELECT id, max(timeStamp) AS timeStamp FROM yourTable GROUP BY id) b WHERE a.id = b.id AND a.timeStamp = b.timeStamp Ping 12/6/01 at 5:35pm --- "Tomasi, Chuck" <[EMAIL PROTECTED]> wrote: > Thanks to all who responded. The winning solution > (with a few > modifications) went something like this: > > select > d1.id > ,d1.tapeid > ,d1.locid > ,d1.mdate > from tape_change_log d1 > where d1.mdate = ( > select max(d2.mdate) > from tape_change_log d2 > where d2.tapeid = d1.tapeid > group by d2.tapeid > ) > order by > id > ,tapeid > > Thanks again > > --Chuck > > P.S. -confession- this was not my problem, I posted > for a coworker since I > couldn't give him a direct solution. __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com
