Received: from mail.enterprise.net (root@mail.enterprise.net [194.72.192.18]) by hub.org (8.9.1/8.9.1) with ESMTP id MAA04429 for ; Tue, 17 Nov 1998 12:43:28 -0500 (EST) (envelope-from olly@lfix.co.uk) Received: from linda.lfix.co.uk (root@max05-044.enterprise.net [194.72.198.44]) by mail.enterprise.net (8.8.5/8.8.5) with ESMTP id RAA18517; Tue, 17 Nov 1998 17:43:25 GMT Received: from linda.lfix.co.uk (olly@localhost [127.0.0.1]) by linda.lfix.co.uk (8.9.1a/8.9.1/Debian/GNU) with ESMTP id RAA22165; Tue, 17 Nov 1998 17:43:12 GMT Message-Id: <199811171743.RAA22165@linda.lfix.co.uk> X-Mailer: exmh version 2.0.2 2/24/98 (debian) To: Takashi Tokunaga cc: pgsql-sql@postgreSQL.org Subject: Re: [SQL] How To Use JOIN? In-Reply-To: Message from Takashi Tokunaga of "Wed, 18 Nov 1998 00:05:45 +0800." <199811171611.BAA25713@yebisu2.digital-magic.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 17 Nov 1998 17:43:12 +0000 From: "Oliver Elphick" 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