I've got a new job and the former woman that did my job left a guide for her tasks. Usually they are very good, but I got one where it says I'm supposed to run this query in PGadmin:
SELECT n2.cpr, n2.adresseringsnavn, n2."fødselsdato" AS foedselsdato, n2.morcpr, n1.mor_navn, n2.farcpr, n3.far_navn FROM (SELECT * FROM data.cpr_aktivkom_geoview WHERE cpr = 'x' OR cpr = 'x' OR cpr = 'x' OR cpr = 'x' OR cpr = 'x' OR cpr = 'x' OR cpr = 'x' OR cpr = 'x' OR cpr = 'x' OR cpr = 'x' OR cpr = 'x') n2 INNER JOIN (SELECT cpr, adresseringsnavn AS mor_navn FROM data.cpr_aktivkom_geoview) n1 ON n2.morcpr = n1.cpr LEFT JOIN (SELECT cpr, adresseringsnavn AS far_navn FROM data.cpr_aktivkom_geoview) n3 ON n2.farcpr = n3.cpr ORDER BY n2."fødselsdato" asc It gives me this error:
ERROR: syntax error at or near "." LINE 2: n2.cpr, ^ SQL state: 42601 Character: 14 I have no idea what I'm doing. Can anyone spot whatWhat is the problem is with the dot after the n2's, n1's and n3's?