sql语句(100分)

  • 主题发起人 冰女孩
  • 开始时间

冰女孩

Unregistered / Unconfirmed
GUEST, unregistred user!
其中t_content字段是Tmemo型的。
strsql:='select * from titleinfo where t_content like "%%冷静%%"';
query1.close;
query1.sql.clear;
query1.sql.add(strsql);
query1.open;

请问这语句有错吗?我怎么老是出错呢。
 
据说MEMO类型是不可以搜索的。改成VChar吧。
如果确需要在MEMO中搜索,可以使用全文检索。
另外,模糊查询用一个百分号就够了。....like '%冷静%'
 
"%%冷静%%"
应该用单引号吧!
 
语句没有错..楼上的说的对..
 
同意3h说的,请试一下
 
->strsql:='select * from titleinfo where t_content like "%%冷静%%"';
改为
[red]strsql:='select * from titleinfo where t_content like ''%冷静%''';[/red]

 
strsql:='select * from titleinfo where t_content like ''%冷静%''';

才是对的,我也是这样认为的,,为什么要用TMEMO了..?
 

Similar threads

顶部