Change ISNULL
to COALESCE
and square brackets to "
and then it validates.
SELECT a.UserAccountKey,
SUM(COALESCE(b."measure Y", 0.0)) AS "measure Y",
SUM(COALESCE(c."measure Z", 0.0)) AS "measure Z"
FROM XXX a
LEFT OUTER JOIN YYYY b
ON a.UserAccountKey = b.UserAccountKey
LEFT OUTER JOIN ZZZZ c
ON a.UserAccountKey = c.UserAccountKey
GROUP BY a.UserAccountKey;
This does mean that you need to ensure that QUOTED_IDENTIFIER
is ON
in SQL Server.