方案1:

(SELECT top 10 *
  FROM 表 where type=3
  ) UNION ALL
  (SELECT top 10 *
  FROM 表 where type=4
  )
  UNION ALL
  (SELECT top 10 *
  FROM 表 where type=5
  )

方案2:

select * from
 (select *,row_number()over(partition by type order by id desc) as RN from 表 t
 where type in (3,4,5)
 )a where rn <=10;

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2021-11-05
  • 2021-11-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-07
  • 2021-11-18
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案