select * from ecms_article where title like '%ftitle%' order by id desc limit 6 表:ecms_article 
字段1: title 
字段2: ftitle 以(字段2: ftitle)的内容,用SQL做模糊搜索(title like '%ftitle%') 在(字段1: title)里面,找出来带有(字段2: ftitle)的内容!

解决方案 »

  1.   

    贴记录及要求结果出来看看
    1、
    select * from ecms_article where title like 
    concat('%',ftitle,'%') order by id desc limit 6 2
    select * from ecms_article where instr(title,ftitle)>0
      

  2.   

    SELECT * FROM ecms_article where INSTR(title,ftitle)>0
      

  3.   

    or
    select * from ecms_article where locate(ftitle,title)>0
      

  4.   

    用LOCATE、INSTR均可以解决问题2,1用LIKE concat('%',ftitle,'%')就OK了。
      

  5.   

    楼主写的,和要表达不明如果是在一条记录里面出现的,楼上的已经解决了,
    1、 
    select * from ecms_article where title like 
    concat('%',ftitle,'%') order by id desc limit 6 2 
    select * from ecms_article where instr(title,ftitle)>0如果要求是在不同记录出现的。
    建议分成2步。
    如果硬要一步完成:
    select * from ecms_article a right join ecms_article b on b.title like 
    concat('%',a.ftitle,'%') where a.title like '%指定串%'可能把楼主的 title和 ftitle给写反了,因为楼主写的注释和使用的例子,我看着有问题。
    楼主自己调整吧。