delphi中表示字符串一般在单引号之间,在C++BUILD中有个查询是这样的:
"select * from animals where name like '%"+inputstring+"%'"
请问,在DELPHI中怎么表示上面这个查询?
注意:其中inputstring是个string类型的变量。

解决方案 »

  1.   

    'select * from animals where name like '''%'+inputstring+'%'''
      

  2.   

    'select * from animals where name like ''%'+inputstring+'%'''
      

  3.   

    'select * from animals where name like '''+'%'+inputstring+'%'+''''
      

  4.   

    顺便说一下: linzhisong(無聊) 兄的
    编译无法通过,可能是他疏忽了^o^
      

  5.   

    'select * from animals where name like '+#39+'%'+inputstring+'%'+#39
      

  6.   

    'select * from animals where name like '+#39+'%'+inputstring+'%'+#39
      

  7.   

    'select * from animals where name like ''%'+inputstring+'%'''
      

  8.   

    delphi中字符串裡面的'用兩個''代替,如:S: 123'456S := '123''456';
      

  9.   

    select * from animals where name like 
    QuotedStr('%'+inputstring+'%')