David Gagnon <[EMAIL PROTECTED]> writes:
> update test set id=test2.id from test2 where id=test2.id;
>
> ERROR: column reference "id" is ambiguous
It's complaining about the second use of "id", which could mean either
"test2.id" (which would be a self-join) or "test.id" (which is what
you want).
I have a construct where column has the same name .. and when I use the
FROM clause I get the following error:
create table test (
id varchar(8)
);
create table test2 (
id varchar(8)
);
update test set id=test2.id from test2 where id=test2.id;
ERROR: column reference "id" is ambi
Stephan Szabo <[EMAIL PROTECTED]> writes:
> On Fri, 8 Jul 2005, David Gagnon wrote:
>> UPDATE gl SET gl.glnum = gl.glnum
>> ERROR: column "gl" of relation "gl" does not exist
>>
>> the TABLE.COLUMN is not in the SQL standard ?
> For at least 92 (and I'm almost certain 99) not in the SET list. I
On Fri, Jul 08, 2005 at 09:59:03 -0400,
David Gagnon <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I was juste wondering why the following code don't work:
Because the value being set is a column name from the table being updated
and you aren't allowed to qualify it with a table name.
You don't rea
On Fri, 8 Jul 2005, David Gagnon wrote:
> Hi all,
>
> I was juste wondering why the following code don't work:
> UPDATE gl SET gl.glnum = gl.glnum
> ERROR: column "gl" of relation "gl" does not exist
>
> While the following works:
> UPDATE gl SET glnum = glnum;
>
> Query returned successfully: 1