select ID,MainFunctionID,MainFunction,MainID,MainIDDescription,ModeID,ActionPageName,ActionBtnName,Description,IsActive,ModifyID,ModifyDate
from T_LogWriteSet where MainID = ''' AND Description Like '%'%'
请问 AND Description Like '%'%' 最后面一个%为什么没用呢?
哪里没用
select ID,MainFunctionID,MainFunction,MainID,MainIDDescription,ModeID,ActionPageName,ActionBtnName,Description,IsActive,ModifyID,ModifyDate
from T_LogWriteSet where MainID = ''' AND Description Like 'g'g'
Incorrect syntax near 'g'.
SQL code:
if object_id('tb') is not null drop table tb
go
create table tb(id int identity(1,1),name varchar(10))
insert tb select
'' union all select
'1' union all select
'1''2' union all select
'9'''
/*
select * from tb
id name
----------- ----------
1
2 1
3 1'2
4 9'
(4 行受影响)
*/
select * from tb where name like '%''%'
id name
----------- ----------
3 1'2
4 9'
(2 行受影响)
???
SQL code:
select ID,MainFunctionID,