I'm trying to do a sub-select and Inner Join in the same query, with little success.
The query, as it stands is below, and returning the error
The multi-part identifier "Company.LocalityId" could not be bound.
UPDATE Company
SET
Company.BusinessRegionId = b.Id
FROM
(
SELECT
Id
FROM
BusinessRegion
WHERE
tag = 'Australia/New South Wales'
) b
INNER JOIN Locality l ON
Company.LocalityId = l.Id
where
l.StateOrProvinceAbbreviation = 'NSW'
Any assistance would be gratefully received.