Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Getting rid of repeating rows

I have the following data:

USER_ID USER_NUMBER ACTIVATE_DATE DEPT_NUM ..., ...
--- ---- ---- ---
aaaaaa 12345678 20020910 6410
aaaaaa 22334567 20010810 6410
bbbbbb 12345523 19990108 6410
cccccc 84746537 19990704 2310
cccccc 19980804 2310
cccccc 34333456 19970101 2310

Now my question. How do I get only the first occurance of a USER_ID without
using DESTINCT in the SELECT statement? The reason for this is that
in my SELECT statement I select the first three columns of the record sorted
by USER_ID and ACTIVATE_DATE. Background info: The user_id is linked to a
particular post indicated by the USER_NUMBER. When this number changing for
a particular USER_ID it means that a new person has been appointed to that
job or post.
[859 byte] By [Werner] at [2007-11-9 21:10:20]