Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 To get the first occurance of repeated column

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-07-02 : 09:07:41
Annie writes "Look at the table

Table1
userid projid
10 20
10 30
10 40
20 20
20 40
50 30
50 60
50 90
50 80

i want a select qury which will return

table2
userid projid
10 20
20 20
50 30"

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2004-07-02 : 09:22:52
select userid, min(projid) as projid
from table1
group by userid


Duane.
Go to Top of Page
   

- Advertisement -