Syntax error needs explanation - Mailing list pgsql-general

From Rich Shepard
Subject Syntax error needs explanation
Date
Msg-id 9c84776d-d938-9fa4-ab1-6ee960ce6e7d@appl-ecosys.com
Whole thread Raw
Responses Re: Syntax error needs explanation
Re: Syntax error needs explanation
List pgsql-general
I have the following script:

select c.company_nbr, c.company_name, i.industry, 
from companies as c, industry as i, enforcement as e
where exists (
   select c.company_nbr, count(e.action_date), sum(e.penalty_amt)
   from e.enforcement
   where c.company_nbr = e.company_nbr
   )
group by industry
order by industry;

When I run it psql reports an error:
psql:companies-with-enforcement-actions.txt:127: ERROR:  syntax error at or near "company_nbr"
LINE 1: company_nbr |               company_name
         ^
and I'm not seeing the error. What am I missing?

TIA,

Rich



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Bypassing Directory Ownership Check in PostgreSQL 16.6 with Secure z/OS NFS (AT-TLS)
Next
From: "David G. Johnston"
Date:
Subject: Re: Syntax error needs explanation