select distinct a from table1
解决方案 »
- sql语句写法再次请教!!
- 一个SQL连接的问题
- 请教大家,有关sqlserver2000数据库移植到sql server 2012的问题
- 请教数据库高手--怎样用SQL语句(在存储过程或某个表中)备份某个数据库呢?
- 怎样截取datetime类型中的日期,并且按照日期group?
- ***谁有关于用image做参数的sql server存储过程的代码*****
- 学vfp的朋友帮忙看看,急
- 关于sql 语句的优化!谢谢各位大侠!
- 怎幺修改sql server数据库的名字?
- 数据库大比较!
- 我用powerdesign设计表,但我选字段数据类型时没找到autoincrement一项,为什么,我该如何完成
- 关于一个附加数据库的问题????????????????????
1.select distinct a from A
2.select a from A group by a
create unique nonclustered index 字段a_ind on 表A(a)
delete from t where id in (select id from t ttt where ttt.a=t.a and ttt.id>t.id)
ALTER TABLE yourtable DROP COLUMN id
ALTER TABLE t ADD id int IDENTITY(1,1) NOT NULL
delete from t where id in (select id from t ttt where ttt.a=t.a and ttt.id>t.id)
ALTER TABLE t DROP COLUMN id