Skip to content
Advertisement

How to update status for part with nothing data when this part is missed?

I work with SQL Server 2012 and have an issue: I can’t update status with No data returned where no result returned from select statement cross apply function.

Meaning where no data returned when join parts and company to function then update status to this part with nothing data for that part when data is missing.

When I run a select as shown below, it does not return data for some parts so I will update status with nothing data returned to this part:

What I need to do when any parts and company on temp table join with function is missed, then update status to this part with nothing data for this part .

Expected result:

How to do that please ?

Advertisement

Answer

If I understand correctly, you want outer apply, but you also need a subquery:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement