select * from tablename where 'abcde' like '%'+ columnname +'%'
--用SQL Server 2005 吗? SQL server 2005 就有很多解决办法了.
zlp321002(龙卷风2006) 你能把方法贴出来吗?
create table t(col varchar(100)) insert t select 'abc' union all select 'bc' union all select 'abcd' union all select 'bcd'select * from t where charindex(col,'abcde')>0drop table t /* col --------------------------------------------- abc bc abcd bcd */
select * from tablename where 'abcde' like '%'+ columnname +'%'
你能把方法贴出来吗?
insert t select 'abc'
union all select 'bc'
union all select 'abcd'
union all select 'bcd'select * from t
where charindex(col,'abcde')>0drop table t
/*
col
---------------------------------------------
abc
bc
abcd
bcd
*/