Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
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
Please
log in
to post a comment.
Adding, subtracting, rounding and calculating differences
how can i mix both querys
Deepak
consecutive_nums_2
parameters_in_procedure-join&correlated sub-query content
Second Query
bc160401882
QLDT DB
Empresa
1512081 QUAN LY DE TAI
Please log in to post a comment.