Received: from shaked.cc.openu.ac.il (shaked.cc.openu.ac.il [147.233.145.65]) by hub.org (8.9.1/8.9.1) with ESMTP id LAA28654 for ; Tue, 17 Nov 1998 11:36:22 -0500 (EST) (envelope-from herouth@oumail.openu.ac.il) Received: from [147.233.159.109] (herouth@mac-herouth.pc.openu.ac.il [147.233.159.109]) by shaked.cc.openu.ac.il (8.8.8/8.8.8) with ESMTP id SAA01405; Tue, 17 Nov 1998 18:36:03 +0200 (IST) X-Sender: herouth@shaked.cc.openu.ac.il Message-Id: In-Reply-To: <199811171611.BAA25713@yebisu2.digital-magic.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Tue, 17 Nov 1998 18:36:35 +0200 To: Takashi Tokunaga From: Herouth Maoz Subject: Re: [SQL] How To Use JOIN? Cc: pgsql-sql@postgreSQL.org 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