From: Herouth Maoz <herouth@oumail.openu.ac.il>
To: Christian Rudow <Christian.Rudow@thinx.ch>
To: PostgreSQL SQL <pgsql-sql@postgreSQL.org>
Subject: Re: [SQL] Using Update
Date: Mon, 28 Jun 1999 12:13:49 +0300
Message-ID: <l03130303b39cec11db6a@[147.233.159.109]> (raw)
In-Reply-To: <377731EB.AACAEA8B@thinx.ch>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: herouth@oumail.openu.ac.il, Christian.Rudow@thinx.ch
Subject: Re: [SQL] Using Update
In-Reply-To: <l03130303b39cec11db6a@[147.233.159.109]>
References: <377731EB.AACAEA8B@thinx.ch> <l03130303b39cec11db6a@[147.233.159.109]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox