select * from table where username like '%x%'
这句sql在delphi中应该怎么写?
'select * from table where username like ''%'+x+'%''';
我是这么写的,貌似不对,X是控件传过来的一个变量
ADOQuery1.SQL.Text:='select title as 标题,truename as 姓名,content as 简报内容,kyear as 年,kmonth as 月,text as 备注 from plans where kyear = '''+x+''' and kmonth like ''%'+y+'%''';
这是我的语句,一执行就报错,报X那里有语法错误,而且无法实现模糊查询
是字符串类型的,郁闷了..