软件下载吧文章资讯

分类分类

SQL开发知识:Sql Server 开窗函数Over()的使用实例详解

2024-02-14 10:20作者:下载吧

利用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

展开全部

相关文章

说两句网友评论
    我要跟贴
    取消