SQL Server 2017 fixes the plan quality issues of previous releases via three new features: interleaved execution for multi-statement table-valued functions (TVFs), batch-mode execution adaptive joins, ...
I'm doing a package tracking feature for the website of a delivery service out here. I'm trying to perform an inner join based on the success of an if statement in my sql query.