日期:2014-05-18  浏览次数:20503 次

奇怪的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___'
一条查询结果都没有,到底是什么问题?

------解决方案--------------------
这样吧。
SQL code
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___ '