From: | Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il> |
---|---|
To: | Takashi Tokunaga <taka-tok(at)chaos(dot)digital-magic(dot)co(dot)jp> |
Cc: | pgsql-sql(at)postgreSQL(dot)org |
Subject: | Re: [SQL] How To Use JOIN? |
Date: | 1998-11-17 16:36:35 |
Message-ID: | l03110707b277562a7e9b@[147.233.159.109] |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Oliver Elphick | 1998-11-17 17:43:12 | Re: [SQL] How To Use JOIN? |
Previous Message | Takashi Tokunaga | 1998-11-17 16:05:45 | How To Use JOIN? |