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
 Transact-SQL (2000)
 How do I write this query

Author  Topic 

jerryk
Starting Member

1 Post

Posted - 2007-01-22 : 21:03:03
Hi,

I have a table that has field called alternateUserID. alternateUserID is a text field that contains a concatenated string of the form ";userid1;userid2;userid3" or "userid1;userid2". I would like to use these alternate user IDs in a IN clause such as "Select * from data where data.UserID in "AlternateUserList"". Any suggestions for how to approach this? Perhaps a User Defined function to parse the AlternateUserList?

Thanks,

Jerry

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-01-22 : 21:13:53
is the alternateUserID in same table as UserID ?

select * from data where alternateUserID like '%' + data.UserID + '%'



KH

Go to Top of Page
   

- Advertisement -