declare @tbl table (aaa varchar(50))
declare @src table (aaa varchar(50))
insert into @tbl values ('aaa'), ('aaabcd'), ('bcd'), ('zzzaaa')
insert into @src values ('aaa')
-- select only equel strings (same as t.aaa = s.aaa)
select * from @tbl t join @src s on t.aaa like s.aaa
update @src set aaa = '%' + aaa + '%'
-- select all the records from t that contain s.aaa
select * from @tbl t join @src s on t.aaa like s.aaa
No comments:
Post a Comment