Re: Left join syntax error

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Left join syntax error
Date: 2024-05-18 15:01:53
Message-ID: 23486d5-be1e-f152-2b97-e027ef89a810@appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, 18 May 2024, Ray O'Donnell wrote:

> You need to include the alias for the table also - see "...from companies as
> c..." in Shammat's example.

Ray,

That didn't work:
bustrac-# FROM people as p, companies as c
bustrac-# LEFT JOIN companies as c ON c.company_nbr = p.company_nbr;
ERROR: table name "c" specified more than once

so I tried only the alias on the join line:
bustrac-# LEFT JOIN c ON c.company_nbr = p.company_nbr;
ERROR: relation "c" does not exist
LINE 3: LEFT JOIN c ON c.company_nbr = p.company_nbr;
^
and that didn't work either.

Thanks,

Rich

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2024-05-18 15:03:42 Re: Left join syntax error
Previous Message Adrian Klaver 2024-05-18 15:01:17 Re: utf8 vs UTF-8