public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Rich Shepard <[email protected]>
Cc: [email protected]
Subject: Re: Syntax error needs explanation
Date: Mon, 14 Jul 2025 12:14:47 -0700
Message-ID: <CAKFQuwZ2vqO68y6A64R0VYpsw=uhh1ZaVd-bxeswHRsw2YTnkg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On Mon, Jul 14, 2025 at 12:12 PM Rich Shepard <[email protected]>
wrote:

> 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?
>

The error indicates your script file is at least 127 lines long and you are
showing like 9...also do you usually name your script files with a .txt
extension?

David J.


view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Syntax error needs explanation
  In-Reply-To: <CAKFQuwZ2vqO68y6A64R0VYpsw=uhh1ZaVd-bxeswHRsw2YTnkg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox