Cross Apply - how can I still bring back the rows

Camillia
Camillia used Ask the Experts™
on
This is a related question that Scott helped me with

https://www.experts-exchange.com/questions/29145132/Adding-up-rows.html?headerLink=workspace_answered_questions

And I'm on SQL 2012

I'm running into an issue now that I have more data. You see that #FSS table and Cross Apply? when the #FSS table is empty, I don't get any rows back. I commented that Cross Apply (and fields related to it) and I get rows back.

How can I change it to say... give me rows even if #FSS is empty?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
I tried Outer Apply but not sure if that's correct. I do see the data now.
SQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015
Commented:
< Knee-jerk answer without looking at the original question >  Change the CROSS APPLY to an OUTER APPLY.
Yeah, just did that (we posted at the same time) and I get rows back. Let me read about Outer Apply and see what the difference is.
Jim HornSQL Server Data Dude
Most Valuable Expert 2013
Author of the Year 2015
Commented:
OUTER APPLY is the equivalent of a CROSS APPLY with a LEFT JOIN instead of INNER JOIN, so all the rows on the left side will be returned.

<rant>  Why isn't it called something more intuitive like LEFT APPLY?  Because Microsoft needs to be able to ask very un-intuitive questions on certification exams.  </rant>
Ha. Thanks. I'll test more. Seems to be working .

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial