Sql Server cross apply和outer apply

with result as(
select t.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t
cross apply
(select t2.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t2
where t.str = t2.str) t3)
select * from result;
go with result as(
select t.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t
outer apply
(select t2.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t2
where t.str = t2.str) t3)
select * from result;
go select t.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t
cross apply
(select t2.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t2
where t.str = t2.str) t3;
go
上一篇:初学python列表


下一篇:How do I UPDATE from a SELECT in SQL Server?