select t1.title,COUNT(t2. arid) as count
from discusstopic as t1,topicarticle as t2
where t1.topicid=t2.topicid?
from discusstopic as t1,topicarticle as t2
where t1.topicid=t2.topicid?
解决方案 »
- 如何发布带有mysql数据库的应用程序?
- 请教多表多条件下求和运算
- ubuntu 10 安装mysql ,ERROR 2002 (HY000): Can't connect to local MySQL server throu
- 求查询大于和小于某个时间
- linux下mysql如何导入.txt文件
- 有关SQL时间复杂度的问题,请指教。
- 为何重装mysql时 重装不了了
- 数据库里data类型可以只存储年月吗?
- mysql如何实现某几个字段不重复插入数据?
- Mysql8.0,如何根据json(数组)里的字段排序
- 怎样访问远程数据库?
- 紧急求助:我的服务器掉电了,重新启动MYSQL启动不了了!!!错误如下:
from discusstopic a inner join topicarticle b on a.topicid=b.topicid
group by a.topicid order by ...
我的建议是只建立一张表,对贴主加一个字段orgin让它初值为-1
回复的帖子orgin都为0
查询时候分两个语句,这样效率是不是高些?
浅妄薄见,望与斟酌