asp的一个问题

lovebanyi 2004-08-25 03:22:33
我有一个表reforum里面有三个字段id(自动编号) username(字符) topicid(数字)
select topicid from reforum where username='CSDN'
返回的时候会有好几个 topicid是重复的。我只想一个就可以了。
...全文
149 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
lovebanyi 2004-08-25
  • 打赏
  • 举报
回复
还有使用了distinct就没有办法进行排序了。该用什么方法来排序?
lovebanyi 2004-08-25
  • 打赏
  • 举报
回复
如果把所有的数据全部取出来呢? 不是只取 topicid有没有办法实现
lbd8848 2004-08-25
  • 打赏
  • 举报
回复
不好意思
lovebanyi 2004-08-25
  • 打赏
  • 举报
回复
阗是郁闷哦。
select top 1 topicid from reforum where username='CSDN'
这样行吗 不过你的第二种是可以了
lbd8848 2004-08-25
  • 打赏
  • 举报
回复
1. select top 1 topicid from reforum where username='CSDN'

2. select distinct topicid from reforum where username='CSDN'

miqier 2004-08-25
  • 打赏
  • 举报
回复
select distinct topicid from reforum where username='CSDN'

28,390

社区成员

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

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