pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Herouth Maoz <herouth@oumail.openu.ac.il>
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 18:36:35 +0200
Message-ID: <l03110707b277562a7e9b@[147.233.159.109]> (raw)
In-Reply-To: <199811171611.BAA25713@yebisu2.digital-magic.co.jp>

At 18:05 +0200 on 17/11/98, Takashi Tokunaga wrote:


> 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

You seem to have forgotten a comma...

SELECT *
FROM test1, test2   <---- Here
WHERE code1 = code2;

if you don't put a comma, "test2" will be used as an alias to "test1", not
as a table on its own.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma





view thread (3+ messages)  latest in thread

Message-ID: <l03110707b277562a7e9b@[147.233.159.109]>
Permalink:  ../l03110707b277562a7e9b@%5B147.233.159.109%5D/
Also on:    postgresql.org/message-id/l03110707b277562a7e9b@[147.233.159.109]

 · 

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 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: herouth@oumail.openu.ac.il, taka-tok@chaos.digital-magic.co.jp
  Subject: Re: [SQL] How To Use JOIN?
  In-Reply-To: <l03110707b277562a7e9b@[147.233.159.109]>
  References: <199811171611.BAA25713@yebisu2.digital-magic.co.jp> <l03110707b277562a7e9b@[147.233.159.109]>

* 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