取不同类别的第一条数据

select a.* from tb a where val = (select top 1 val from tb where name = a.name)

select row_number()over(order by Size )as RowNum,*from O_OrderWovenLabel 'row_number()over(order by Size )表示得到某一列的行号
Select no=Identity(int,1,1),* Into #temptable From (select * from  View_Get_Paper_JEAN_Data )B '这里是得到一个临时表no是自动增加号
select  * from #temptable A where [no]=(select top 1 [no] from #temptable where Trim_Ref = A.Trim_Ref) '这里是自动增加号,来嵌套查询,得到不同类别的第一条数据

相关文章:

  • 2021-08-31
  • 2022-01-25
  • 2022-12-23
  • 2021-11-07
  • 2021-12-09
  • 2021-06-06
  • 2022-12-23
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2021-05-26
  • 2021-11-07
  • 2021-07-02
  • 2021-06-25
  • 2022-12-23
  • 2021-08-26
相关资源
相似解决方案