pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ligia Pimentel <pimentel_ligia@hotmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Update  help
Date: Thu, 5 Sep 2002 12:29:47 -0500
Message-ID: <al885a$1t1h$1@news.hub.org> (raw)
References: <OE50r7MoNYXRRS6HtHO00000811@hotmail.com>

update table1 set price = table2.price
where table1.productId = table2.productId;

(Of course, both tables must have a different name).

:)
Ligia



""Yudieg@hotmail.com"" <yudieg@hotmail.com> wrote in message
news:OE50r7MoNYXRRS6HtHO00000811@hotmail.com...
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_00AA_01C2533B.BE837FA0
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> Hi,
> Let say I have 2 Product table, both of them has columns ProductID and
Price
> What is the update command if I want to update all Prices of first table
to=
>  be equal with Price in second table?
>
> Please Help.
>
> Yudie
> ------=_NextPart_000_00AA_01C2533B.BE837FA0
> Content-Type: text/html;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html;
charset=3Diso-8859-1">
> <META content=3D"MSHTML 5.50.4916.2300" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2>Let say I have 2 Product table, both of
th=
> em has=20
> columns ProductID and Price</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2>What is the update command if I want to
up=
> date=20
> all&nbsp;Prices of first table to be equal with Price in second=20
> table?</FONT></DIV>
> <DIV>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>Please Help.</FONT></DIV>
> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
> <DIV><FONT face=3DArial size=3D2>Yudie</FONT></DIV></BODY></HTML>
>
> ------=_NextPart_000_00AA_01C2533B.BE837FA0--





view thread (12+ messages)

Message-ID: <al885a$1t1h$1@news.hub.org>
Permalink:  ../al885a$1t1h$1@news.hub.org/
Also on:    postgresql.org/message-id/al885a$1t1h$1@news.hub.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: pimentel_ligia@hotmail.com
  Subject: Re: Update  help
  In-Reply-To: <al885a$1t1h$1@news.hub.org>

* 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