查询用户名以发贴多少排列,要同时查询两个表!
select u_info.u_name as name,u_info.u_mail from u_topic,u_info order by (select count(u_topic.id) from u_topic,u_info where u_topic.u_name=name) asc
还有其它办法吗?order by 只能是后面只能是字段名吗,不能是其它条件吗?
...全文
259打赏收藏
求救这个MYSQL的查询语句怎么写
查询用户名以发贴多少排列,要同时查询两个表! select u_info.u_name as name,u_info.u_mail from u_topic,u_info order by (select count(u_topic.id) from u_topic,u_info where u_topic.u_name=name) asc 还有其它办法吗?order by 只能是后面只能是字段名吗,不能是其它条件吗?