From: Oliver Elphick <olly@lfix.co.uk>
To: Takashi Tokunaga <taka-tok@chaos.digital-magic.co.jp>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] How To Use JOIN?
Date: Tue, 17 Nov 1998 17:43:12 +0000
Message-ID: <199811171743.RAA22165@linda.lfix.co.uk> (raw)
In-Reply-To: <taka-tok@chaos.digital-magic.co.jp> <199811171611.BAA25713@yebisu2.digital-magic.co.jp>
Takashi Tokunaga wrote:
>Hello PGSQL users, I'm having trobule using join statement:
>3. Now after that worked without any problem, so I now create SELECT
> statement:
>
> select * from test1 test2 where code_1 = test.code_2 \g
> ERROR: attribute 'code_2' not found
>
>nope that didn't work
>
> select test1.name_1 from test1 test2 where test1.code_1 = test2.code_2 \g
> ERROR: attribute 'code_2' not found
>
>Umm... still no change.
junk=> select * from test1, test2 where code_1 = test2.code_2
junk-> ;
name_1|code_1|name_2|code_2
------+------+------+------
10| 1| 11| 1
11| 2| 11| 2
(2 rows)
junk=> select test1.name_1 from test1, test2 where test1.code_1 = test2.code_2 ;
name_1
------
10
11
(2 rows)
You omitted the comma between the table names in the FROM clause.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP key from public servers; key ID 32B8FAA1
========================================
"For by grace are ye saved through faith; and that not
of yourselves. It is the gift of God; not of works,
lest any man should boast." Ephesians 2:8,9
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: olly@lfix.co.uk, taka-tok@chaos.digital-magic.co.jp
Subject: Re: [SQL] How To Use JOIN?
In-Reply-To: <199811171743.RAA22165@linda.lfix.co.uk>
References: <199811171743.RAA22165@linda.lfix.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox