执行:
select a.wid, a.hit+b.hit+c.hit hits from tb_bajieword a join tb_bajieword b join tb_bajieword c on a.wid=b.wid and a.wid=c.wid where a.word='开放' and b.word='图片' and c.word='因为' order by hits desc;
得到21个结果
但执行:
select a.wid, a.hit+b.hit+c.hit+d.hit hits from tb_bajieword a join tb_bajieword b join tb_bajieword c join tb_bajieword d on a.wid=c.wid and a.wid=d.wid where a.word='开放' and b.word='图片' and c.word='因为' and d.word='站长' order by hits desc;
却得到了6069个结果肯定是什么地方出问题,请大侠赐教。
select a.wid, a.hit+b.hit+c.hit hits from tb_bajieword a join tb_bajieword b join tb_bajieword c on a.wid=b.wid and a.wid=c.wid where a.word='开放' and b.word='图片' and c.word='因为' order by hits desc;
得到21个结果
但执行:
select a.wid, a.hit+b.hit+c.hit+d.hit hits from tb_bajieword a join tb_bajieword b join tb_bajieword c join tb_bajieword d on a.wid=c.wid and a.wid=d.wid where a.word='开放' and b.word='图片' and c.word='因为' and d.word='站长' order by hits desc;
却得到了6069个结果肯定是什么地方出问题,请大侠赐教。
解决方案 »
- as 查询问题
- 求助Mysql执行缓慢的问题
- mysql 查询 延时
- 如何连接远程Mysql数据库。
- 急死我了啊!谁帮帮忙?!刚刚安装完MySQL5.1,启动后,mysqld进程使用的物理内存300多M,虚拟内存也有300多M,怎么设置小点啊...高手进!
- 关于子查询的执行时机的问题.
- mysql 表内的数据乱码
- postgresql如何解决生僻汉字的存储和匹配查询?有没有人用postgresql?
- mysql中通过show table status from mydb 如何控制Data_free>0的内容显示出来?
- mysql导入excel2007之后text类型的数据超过255字节的部分出现乱码,求大神指点
- 怎样按一定时间内对数据进行去重
- 请问php如何调用oracle数据
from tb_bajieword a join tb_bajieword b join tb_bajieword c on a.wid=b.wid and a.wid=c.wid
where a.word='开放' and b.word='图片' and c.word='因为' order by hits desc;
select a.wid, a.hit+b.hit+c.hit+d.hit hits
from tb_bajieword a join tb_bajieword b join tb_bajieword c join tb_bajieword d on a.wid=c.wid and a.wid=d.wid
where a.word='开放' and b.word='图片' and c.word='因为' and d.word='站长' order by hits desc;
你多JOIN了一个表,并且没有任何限制。