|
Posted by SQL on 05/19/06 15:44
what about 2
you will get back the second row with 25 and 23
create table Tbl_ListIDs (ListID int,PropertyID varchar(49))
insert into Tbl_ListIDs
select 1,'75,62,2,4' union all
select 2,'6,25,75,23' union all
select 3,'2,7,36,2' union all
select 4,'4,73,75,4' union all
select 5,'75,62,1,42'
--This should return only 2's that are not part of a bigger number
select * from tbl_listids where PropertyID like '%,2,%' OR
PropertyID like '2,%'
or PropertyID like '%,2'
Denis the SQL Menace
http://sqlservercode.blogspot.com/
Navigation:
[Reply to this message]
|