Mysql SQL使用查询字符串选择喜欢的位置
如果我有这两个复杂的查询字符串Mysql SQL使用查询字符串选择喜欢的位置,mysql,sql,Mysql,Sql,如果我有这两个复杂的查询字符串 ALM_frmTopAlarmHistoryReport.aspx?strAlarmConnection=AlarmSystem 及 如何排除选择类似的位置条件 我试过了 SELECT * FROM [tablename] WHERE string1 LIKE '%string2%' 我得到了下面的错误 Msg 103, Level 15, State 4, Line 1 The identifier that starts with'%st
ALM_frmTopAlarmHistoryReport.aspx?strAlarmConnection=AlarmSystem
及
如何排除选择类似的位置
条件
我试过了
SELECT * FROM [tablename] WHERE string1 LIKE '%string2%'
我得到了下面的错误
Msg 103, Level 15, State 4, Line 1
The identifier that starts with'%string2 ' is too long. Maximum length is 128.
欢迎提供任何帮助,请提前感谢使用locate或instr:
select *
from tablename
where instr(string2, string1) > 0
select *
from tablename
where instr(string2, string1) > 0