Mysql语句,请问错在哪里? SELECT topic.*,
COUNT (retopic.topic_id) AS recount,
MAX (if(re_posttime,re_posttime,posttime)) AS newtime
FROM topic LEFT JOIN retopic
On topic.topic_id =retopic.topic_id
GROUP BY topic.topic_id, forum.topic
ORDER BY newtime DESC
COUNT (retopic.topic_id) AS recount,
MAX (if(re_posttime,re_posttime,posttime)) AS newtime
FROM topic LEFT JOIN retopic
On topic.topic_id =retopic.topic_id
GROUP BY topic.topic_id, forum.topic
ORDER BY newtime DESC
解决方案 »
- Mysql存储过程创建失败,版本5.5,请高手解决
- 关于mysql存储过程,请教,具体内容见正文!
- 关于提取二级分类下N条数据的问题(整了三天了,没整出来,不行了,向大伙求教)
- 连接mysql报错:error2003(hy000:can't connect to mysql server on 'localhost'
- 两个表关联 修改一个表的某个字段 请教大家
- 有没有什么工具可以做到在2个不同机器的mysql 同名表找出不同的数据
- 求SQL代码如何实现
- 问一个连接MYSQL时的一个奇怪的问题,急求解!
- 装了个MYSQL是否影响开机的速度.
- 1405 Access denied for user '[email protected]' 问题
- 如何安装MySQL、Tomcat、CloverCRM
- 如何向mysql的datetime列插入一个数值?插入time_t值部队
COUNT (retopic.topic_id) AS recount,
MAX (if(re_posttime,re_posttime,posttime)) AS newtime
FROM topic LEFT JOIN retopic
On topic.topic_id =retopic.topic_id
GROUP BY topic.topic_id, forum.topic
ORDER BY newtime DESC
你的SQL语句不是标准的SQL格式
max() 单行
count() 单行
这些怎么放到一起??
你的sql语句很乱。
COUNT (retopic.topic_id) AS recount,
MAX (if(re_posttime,re_posttime,posttime)) AS newtime
有错!
Thanks!