Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Update table from another table

Re: Update table from another table

From: BP Margolin <bpmargo_at_attglobal.net>
Date: Tue, 27 Mar 2001 12:36:44 -0500
Message-ID: <3ac0ce29_4@news3.prserv.net>

Michel,

In fact, Germano's syntax is perfectly acceptable and will work. There are multiple ways that the same functionality can be coded in SQL.



BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which can be cut and pasted into Query Analyzer is appreciated.

"Michel Roberge" <mrobergeNO_at_SPAMstarlims.com> wrote in message news:o%_v6.10162$Uy.46538849_at_news1.tor.primus.ca...
> In fact it should be written like this (at least, its the syntax I'd use)
>
> update employee a
> set a.fname = b.fname,
> a.lname = b.lname
> from employee_bk b
> where a.emp_id = b.emp_id
>
>
> "Germano Silva" <germano-silva_at_home.com> wrote in message
> news:99q3g1$h67$1_at_saturn.services.brown.edu...
> > The following should work .
> >
> > update employee
> > set fname = b.fname,
> > lname = b.lname
> > from employee a, employee_bk b
> > where a.emp_id = b.emp_id
> >
> > "CSC" <jcheong_at_cooper.com.hk> wrote in message
> > news:99pqks$75f28_at_imsp212.netvigator.com...
> > > In Oracle, I can issue the following command to update table:
> > >
> > > update employee a
> > > set (a.fname,a.lname) =
> > > (select b.fname,b.lname
> > > from employee_bk b
> > > where a.emp_id = b.emp_id )
> > >
> > > What is the corresponding command in Informix and SQLServer?
> > >
> > >
> > >
> > >
> > >
> > > --
> > > e-Consultant
> > > http://www.asl.com.hk/employment.htm
> > > http://www.eroom.com
> >
> >
>
>
Received on Tue Mar 27 2001 - 11:36:44 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US