2 my 00 my_00 于 2015.06.09 11:17 提问

SQLServer表去掉重复字段数据?

我有一张表,SQLServer表名EvaluateTeacherGrade,如下图所示:
图片说明
问题:我如何获得如下表:

 teacherID   
 20070101
 22222001


 也就是去掉重复的??

恳请各位行家高手不吝惜指教!万分感谢!!

6个回答

frank_20080215
frank_20080215   2015.06.09 12:43

select distinct teacherID from EvaluateTeacherGrade

qq_28882337
qq_28882337 ……
2 年多之前 回复
lcmie
lcmie   2015.06.09 11:23

select distinct teacherID from EvaluateTeacherGrade

caozhy
caozhy   Ds   Rxr 2015.06.09 12:04

select distinct teacherID from EvaluateTeacherGrade

select teacherID from EvaluateTeacherGrade group by teacherID

tongyi55555
tongyi55555   2015.06.09 12:55

筛选出不同的teacherID ,然后存入一个新的表newTable中。

select distinct teacherID  into #Tmp from EvaluateTeacherGrade;
select * into newTable from #Tmp;
drop table #Tmp;
u013370108
u013370108   2015.06.09 14:09

加入distinct字符,表示查询结果不重复

datou431
datou431   Rxr 2015.06.09 15:42

select distinct teacherID from EvaluateTeacherGrade

Csdn user default icon
上传中...
上传图片
插入图片