Re: [SQL] Using Update

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Christian Rudow <Christian(dot)Rudow(at)thinx(dot)ch>, PostgreSQL SQL <pgsql-sql(at)postgreSQL(dot)org>
Subject: Re: [SQL] Using Update
Date: 1999-06-28 09:13:49
Message-ID: l03130303b39cec11db6a@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 11:27 +0300 on 28/06/1999, Christian Rudow wrote:

> I just seem to use the UPDATE not correctly, it cannot be parsed.
> What is the correct solution to this ?
> Can anyone help ?
>
> I know that's a RTFM but I have no FM to R.
> Is there a good SQL tutorial/reference accessible over the net ?

The usual FM is recommended. That is, the PostgreSQL user guide, which
comes with the software, if you compile it from source. Can't guarantee
that it comes with rpms. You can also man (postgres comes with manpages).
And you can also do a "\h update" in psql, to get the bare-bones syntax.

>From the manpage:

SYNOPSIS
update classname set attname-1 = expression-1
[, attname-i = expression-i]
[from from-list]
[where qual]

So, it appears that the correct syntax in Postgres would be:

UPDATE b
SET b.a_id = a.aid
FROM a
WHERE b.custno = a.custno;

Herouth

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ross J. Reedstrom 1999-06-28 14:37:00 Re: [SQL] Using Update
Previous Message Christian Rudow 1999-06-28 08:27:23 Using Update