搜索数据时如何进行数据排序?

ckxp 2003-03-05 09:20:25
select distinct(action) from abc order by id desc
他就会提示distinct 与order by 发生冲突。去掉order by就正常了。

我的目的是想搜索出不重复的数据,重复的数据就不显视了。然后将搜索出的不重复数据按ID排序。
...全文
24 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
叶子哟 2003-03-05
  • 打赏
  • 举报
回复
结果集中必须有order by 的东东!
cmsoft 2003-03-05
  • 打赏
  • 举报
回复
select distinct action,id from abc order by id desc
wscqstu 2003-03-05
  • 打赏
  • 举报
回复
select distinct(action),id from abc order by id desc
這樣就可以了
annkie 2003-03-05
  • 打赏
  • 举报
回复
select distinct action from abc order by id desc

28,391

社区成员

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

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