Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Cross Apply vs Inner Join
create table #temp1 ( col1 int ) insert into #temp1 values(6),(1),(2),(3),(null) create table #temp2 ( col1 int ) insert into #temp2 values(1),(2),(1),(2),(3),(null) select * from #temp1; select * from #temp2 select t1.col1, Sum(t2.col1) AS col1 from #temp1 t1 inner join #temp2 t2 on t1.col1 = t2.col1 GROUP BY t1.col1 SELECT * FROM #temp1 t1 CROSS apply (SELECT sum(col1) AS col1 FROM #temp2 t2 WHERE t1.col1 = t2.col1) A
run
|
edit
|
history
|
help
0
Items
Customer_Orders
service_delivery_task
table variables (temporary tables)
PROC How to store the results of a Proc in a Variable
Libros
MLK Date
SQL CASE WHEN
for xml path concatenation ordered by seqno
Stored procedure