当前位置: 代码迷 >> Sql Server >> 一条sql话语,求高手
  详细解决方案

一条sql话语,求高手

热度:55   发布时间:2016-04-27 12:13:33.0
一条sql语句,求高手
表数据:
 id email number
  1 [email protected] 00001
  2 [email protected] 00001
  3 [email protected] 00002
  4 [email protected] 00002


需要的结果是:

 id email number
  1 [email protected] 00001
  3 [email protected] 00002

sql语句怎么写?


------解决方案--------------------
SQL code
select * from tb twhere not exists(select 1 from tb where number=t.number and id<t.id)
  相关解决方案