On Sat, 18 May 2024, Adrian Klaver wrote:
Show the complete query.
Take the error message as correct, you are specifying 'companies as c' more
then once.
Adrian,
I saw that but didn't know how to specify the alias only one time.
Thanks,
Rich
On Sat, 18 May 2024, Ray O'Donnell wrote:
Look again at Shammat's example! -
SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email, c.company_name
FROM people as p
LEFT JOIN companies as c ON c.company_nbr = p.company_nbr
NB - "... from people as p left join companies as c on " -
On Sat, 18 May 2024, Adrian Klaver wrote:
The query needs to be:
SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email, c.company_name
FROM people as p
LEFT JOIN companies as c ON c.company_nbr = p.company_nbr;
Only reference companies as c once.
Thanks, Adrian. I mis-read your origi
On 2024-05-18 17:12 +0200, David G. Johnston wrote:
> Too lazy to find the docs right now but what you are observing is basically
> an operator precedence effect. The comma join hasn’t happened at the time
> the left join is evaluated and so other tables in the comma join cannot
> appear in the on
On Sat, May 18, 2024 at 7:49 AM Adrian Klaver
wrote:
> On 5/18/24 07:46, Rich Shepard wrote:
> > On Sat, 18 May 2024, Shammat wrote:
> >
> >> Don't put the second table in the FROM part
> >>
> >> SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email,
> >> c.company_name
> >> FROM people as
On Sat, 18 May 2024, Erik Wienhold wrote:
Yes, Rich probably just wants the left join.
Eric,
You're correct: I want certain colums from the people table with their
company name from the companies table.
But I wonder if the implicit cross join syntax ("FROM peoples, companies")
should actual
Erik Wienhold writes:
> But I wonder if the implicit cross join syntax ("FROM peoples, companies")
> should actually produce this error because the explicit cross join
> works:
> SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email,
> c.company_name
> FROM people as p
> C
I wrote:
> But I wonder if the implicit cross join syntax ("FROM peoples, companies")
> should actually produce this error because the explicit cross join
> works:
>
> SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email,
> c.company_name
> FROM people as p
> CROSS JOIN co
On Saturday, May 18, 2024, Erik Wienhold wrote:
> On 2024-05-18 15:19 +0200, Shammat wrote:
> > Am 18.05.24 um 14:52 schrieb Rich Shepard:
> > > It's been a _very_ long time since I wrote a SQL script and, despite
> looking
> > > at my SQL books and web pages, I don't know how to fix the error.
>
On 5/18/24 08:04, Rich Shepard wrote:
On Sat, 18 May 2024, Adrian Klaver wrote:
... LEFT JOIN companies as c ON c.company_nbr = p.company_nbr;
Adrian,
Tried that:
bustrac-# LEFT JOIN companies as c ON c.company_nbr = p.company_nbr;
ERROR: table name "c" specified more than once
Show the c
On 18/05/2024 16:01, Rich Shepard wrote:
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
On Sat, 18 May 2024, Adrian Klaver wrote:
... LEFT JOIN companies as c ON c.company_nbr = p.company_nbr;
Adrian,
Tried that:
bustrac-# LEFT JOIN companies as c ON c.company_nbr = p.company_nbr;
ERROR: table name "c" specified more than once
Thanks,
Rich
On 5/18/24 08:01, Rich Shepard wrote:
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.c
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: tab
On 2024-05-18 15:19 +0200, Shammat wrote:
> Am 18.05.24 um 14:52 schrieb Rich Shepard:
> > It's been a _very_ long time since I wrote a SQL script and, despite looking
> > at my SQL books and web pages, I don't know how to fix the error.
> >
> > The three line script is:
> > -
> > SELECT p.lna
On 5/18/24 07:46, Rich Shepard wrote:
On Sat, 18 May 2024, Shammat wrote:
Don't put the second table in the FROM part
SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email,
c.company_name
FROM people as p
LEFT JOIN companies as c ON c.company_nbr = p.company_nbr
Shammat,
I tried t
On 18/05/2024 15:46, Rich Shepard wrote:
On Sat, 18 May 2024, Shammat wrote:
Don't put the second table in the FROM part
SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email,
c.company_name
FROM people as p
LEFT JOIN companies as c ON c.company_nbr = p.company_nbr
Shammat,
I trie
On Sat, 18 May 2024, Shammat wrote:
Don't put the second table in the FROM part
SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email, c.company_name
FROM people as p
LEFT JOIN companies as c ON c.company_nbr = p.company_nbr
Shammat,
I tried this with this result:
ERROR: missing FR
Am 18.05.24 um 14:52 schrieb Rich Shepard:
It's been a _very_ long time since I wrote a SQL script and, despite looking
at my SQL books and web pages, I don't know how to fix the error.
The three line script is:
-
SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email, c.company_name
It's been a _very_ long time since I wrote a SQL script and, despite looking
at my SQL books and web pages, I don't know how to fix the error.
The three line script is:
-
SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email, c.company_name
FROM people as p, companies as c
LEFT JOIN
20 matches
Mail list logo