sqlserver简单使用Alppy开窗函数等

sqlserver简单使用Alppy

1:code 

select * from tab01;
select *from tab02;
select * from tab01 left join tab02 on tab01.id=tab02.tid
select * from tab01 inner join tab02 on tab01.id=tab02.tid

select * from tab01 outer apply(select *from tab02 where tab01.id=tab02.tid)q
select * from tab01 cross apply(select *from tab02 where tab01.id=tab02.tid)q

2:测试效果

 

3:小结:outer 与left join类似  cross与 inner join 类似的功效

 

sqlserver简单使用开窗函数 over等学习截图

 

posted @ 2023-06-02 19:10  天天向上518  阅读(53)  评论(0)    收藏  举报