時間:2024-02-14 10:20作者:下載吧人氣:26
利用over(),將統計信息計算出來,然后直接篩選結果集
declare @t table(
ProductID int,
ProductName varchar(20),
ProductType varchar(20),
Price int)
insert @t
select 1,’name1′,’P1′,3 union all
select 2,’name2′,’P1′,5 union all
select 3,’name3′,’P2′,4 union all
select 4,’name4′,’P2′,4
網友評論