奇怪的SQL语句问题
Select * From Cover where SerialNo like 'BDJ/___/0710___'
结果正常
Select * From Cover where SerialNo like 'BDJ/部门名/0710___'
结果正常
Select * From Cover where SerialNo like 'BDJ/*/0710___'
一条查询结果都没有,到底是什么问题?
[解决办法]
这样吧。
Select * From Cover where SerialNo like 'BDJ/%/0710___ '
[解决办法]
Select * From Cover where charindex('BDJ/___/0710___',SerialNo) > 0
Select * From Cover where charindex('BDJ/部门名/0710___',SerialNo) > 0
Select * From Cover where charindex('BDJ/*/0710___',SerialNo) > 0
[解决办法]
包含零个或更多字符的任意字符串用%
'BDJ/%/0710___ '