求助用了group by还想按order by ID排序

snfqbujj1 2015-06-02 03:15:37
select xx.id,xx.tid,xx.lb,xx.uid,xx.xq,xx.img,xx.date,xx.gj,xx.lx,xx.mj,xx.zj,xx.fg,xx.hits from picture as xx,(select tid,min([px]) as zz from picture where img is not null and qu=1070 and gj=1 group by tid) as yy where xx.tid=yy.tid and xx.px=yy.zz and xx.gj=1

请教下这在哪里能搞个order by id 呀,我最终想要的是按ID的大小来排序。
...全文
264 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
snfqbujj1 2015-06-04
  • 打赏
  • 举报
回复
多谢楼上两位,的确可以,因为查询条件有点多,我链接的时候写错了,所以没执行。看了两位写的我仔细检查了粗心了。现在已经好了。
Dogfish 2015-06-03
  • 打赏
  • 举报
回复
select 
xx.id, xx.tid,
xx.lb, xx.uid, 
xx.xq, xx.img, 
xx.date, xx.gj, 
xx.lx, xx.mj, 
xx.zj, xx.fg, 
xx.hits 
from picture as xx,
(select tid,min([px]) as zz from picture where img is not null and qu=1070 and gj=1 group by tid) as yy 
where xx.tid=yy.tid and xx.px=yy.zz and xx.gj=1
order by xx.id
  • 打赏
  • 举报
回复
select xx.id,xx.tid,xx.lb,xx.uid,xx.xq,xx.img,xx.date,xx.gj,xx.lx,xx.mj,xx.zj,xx.fg,xx.hits from picture as xx,(select tid,min([px]) as zz from picture where img is not null and qu=1070 and gj=1 group by tid) as yy where xx.tid=yy.tid and xx.px=yy.zz and xx.gj=1
order by xx.id
是这个意思?

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧