我现在的名字是admin,但是我想用adminxx,或者admin后面加其他关键字的查询, select * from tb where col like 'admin%'但是我只想查询出的结果是a开头的所有名字数据,请问怎么实现。 select * from tb where col like 'a%'
--这个? select * from tb where col like 'admin' + 'a%'
我的意思就是说,如果内容是admin,但是我的条件是adminxxx,我想搜索出admin。
select * from tb where name = convert(nvarchar(5),@name)
select * from tb where (convert(char(5),@name)='admin' and name = convert(char(5),@name)) or name like 'a%'@name 是查询条件
select * from tb where col like 'admin%'但是我只想查询出的结果是a开头的所有名字数据,请问怎么实现。
select * from tb where col like 'a%'
select * from tb where col like 'admin' + 'a%'
where (convert(char(5),@name)='admin' and name = convert(char(5),@name)) or name like 'a%'@name 是查询条件