神奇宝贝好看的女角色:对某列排序去掉重复性但要用到全部列的sql语句

来源:百度文库 编辑:高校问答 时间:2024/04/28 15:05:52
如表的列:id,name,subject,tt1,tt2,tt3,tt4等,id为主键 自动编号.在某一个asp页面中,要用到所有列,且要去掉name的重复性,求满足上面要求的sql语句!
这样可以用rs("name")的其他列吗?我试过,是不行的!!!
to:cnscyj - 秀才 二级 6-14 09:29
结果还是不能实现!!!
to:abingpow
老兄,看清楚题目要求啊!!!
竟然没有人回答????

查询相同name值id号最小的一条记录
select a.id,b.name,a.subject,a.tt1,a.tt2,a.tt3,a.tt4 from 表名 where id in(select min(id)as id from 表名 group by name)order by a.id,b.name

select a.id,b.name,a.subject,a.tt1,a.tt2,a.tt3,a.tt4 from 表名 a,(select distinct name from 表名)b where a.name=b.name order by a.id,b.name

select distnct xxxxx from xxx where xxxxxx