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数据库如何访问
- 根据不同条件进行归并,求sql或表设计优化方案
- where条件和order by后条件的索引问题
- 将A表某个字段拷贝到B表的一个字段怎么写?
- 5.1版本中,IF语句能嵌套吗?
- mysql的小问题?
- 哈哈,我现在学会了PHP了,用PHP+MYSQL写了一个简单的论坛,大家快来帮我测试一下。
- 请问那有mysql的jdbc driver库?
- select * form name where inst in('11','22')能得到结果,为什么group_concat生成的不行
- 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给写反了,因为楼主写的注释和使用的例子,我看着有问题。
楼主自己调整吧。