如何写这个查询语句呀,把报刊期数列出来不要重复

smallown 2004-08-11 04:00:04
xb 是表
xb_qk 期刊数 比如1-10期的,每期都有很多的文章xb_id
现在要写一个页面
就是列出全部的期刊数desc排列,
sql="select xb_qk from xb order by xb_qk desc"
这样就变成了很多的重复的一期都出来了
请指点呀

...全文
85 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
smallown 2004-08-11
  • 打赏
  • 举报
回复
谢谢各位,
我用select distinct xb_qk from xb order by xb_qk desc

发现是可以的,
马上结贴送分,
哈哈~~~
ycted 2004-08-11
  • 打赏
  • 举报
回复
sql="select distinct xb_qk from xb order by xb_qk desc"
或者用GROUP BY xb_qk
19az 2004-08-11
  • 打赏
  • 举报
回复
楼上的说得很对,用distinct就可以了,去除重复的记录!
skyboy0720 2004-08-11
  • 打赏
  • 举报
回复
select xb_qk from xb group by xb_qk order by xb_qk desc
  • 打赏
  • 举报
回复
rs.open "select Distinct(classyear) from classes where department like '"&retinfo&"' and classyear is not null",conn,1,1

把classyear换成你的字段名
也就是把有重复的字段加上就行了
Distinct(重复记录的字段)
ydh1981 2004-08-11
  • 打赏
  • 举报
回复
select distinct xb_qk from xb order by xb_qk desc

28,390

社区成员

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

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