Skip to main content
removed meta & social content, improved language & format
Source Link

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?

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 what the problem is with the dot after the n2's, n1's and n3's?

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 
ERROR: syntax error at or near "." LINE 2: n2.cpr, ^ SQL state: 42601 Character: 14 

What is the problem with the dot after the n2's, n1's and n3's?

formatting
Source Link
Charlieface
  • 18.1k
  • 22
  • 45

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 godtgot one where it says I'm supposed to run this query in PGadmin:

    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 what the problem is with the dot after the n2's, n1's and n3's? 
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 what the problem is with the dot after the n2's, n1's and n3's?

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 godt one where it says I'm supposed to run this query in PGadmin:

    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 what the problem is with the dot after the n2's, n1's and n3's? 

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 what the problem is with the dot after the n2's, n1's and n3's?

Source Link

Specific query gives me trouble

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 godt one where it says I'm supposed to run this query in PGadmin:

    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 what the problem is with the dot after the n2's, n1's and n3's?