UPDATE nodes n SET
location_address = (SELECT
CASE
WHEN post_address != '' THEN post_address
ELSE address
END as address
FROM customers c WHERE
c.id = n.ownerid ),
location_city = (SELECT
CASE
WHEN post_city != '' THEN post_city
ELSE city
END as city
FROM customers c WHERE
c.id = n.ownerid),
location_zip = (SELECT
CASE
WHEN post_zip != '' THEN post_zip
ELSE zip
END as zip
FROM customers c WHERE
c.id = n.ownerid)
załatwia to adresy tylko komputerów gdyż one mają ownerid, co z urządzeniami które mają ownerid=0 a są u klienta? komp jest połączony z tym urządzeniem