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: title
字段2: ftitle 以(字段2: ftitle)的内容,用SQL做模糊搜索(title like '%ftitle%') 在(字段1: title)里面,找出来带有(字段2: ftitle)的内容!
解决方案 »
- 下载了一个免安装版的mysql workbench,这东西怎么用?
- linux安装mysql的问题,在线等高手!
- 各位大大帮帮忙啊,这个问题困扰了我几天了,百思不得其解...
- 论坛流量增大时,提示不能连接mysql,应该怎么解决?
- 如何实现按这样要求随意拆分表格 mysql
- 100分求一个简单的sql,请高手帮忙,2天内结贴!
- java开发数据库c/s结构(非web),c端一般用什么开发?
- >安装完MYSQL,如何用啊???<
- 请教,为什么我只能以localhost方式连接mysql?
- 请教条mysql语句
- sqlserver迁移到postgreSQL
- windows下如何实现mysql自动备份
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
select * from ecms_article where locate(ftitle,title)>0
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给写反了,因为楼主写的注释和使用的例子,我看着有问题。
楼主自己调整吧。