SELECT
Query AS "Ключевая фраза",
SUM(CASE WHEN (Updated = '2021-05-20' AND RegionCode = 54) THEN Yandex ELSE 0 END) AS "Yandex ekb",
SUM(CASE WHEN (Updated = '2021-05-20' AND RegionCode = 193) THEN Yandex ELSE 0 END) AS "Yandex vor"
FROM Queries c
LEFT JOIN SitePositions o ON c.Id = o.QueryId
WHERE SiteId = 33
GROUP BY QueryId, Query;