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

Home -> Community -> Usenet -> c.d.o.misc -> Re: MS SQL Server syntax to Oracle

Re: MS SQL Server syntax to Oracle

From: DA Morgan <damorgan_at_psoug.org>
Date: Tue, 17 Apr 2007 08:38:27 -0700
Message-ID: <1176824299.52428@bubbleator.drizzle.com>


fgsdfgsdf wrote:
> Hi all
>
> I have this update statement written for MS SQL Server and need the same
> statement for Oracle (version 9).
> I can not find a way to do joins in an update statement in Oracle - is it
> possible?
>
> update Ver
> set Ver.ObjectCreatedBy = c.CreatedBy,
> Ver.ObjectCreated = c.Created
> from Ver
> join (
> select Object, CreatedBy, Created
> from Ver
> join (
> select Object Obj, min(created) Cre
> from Ver
> group by Object
> ) b on Ver.Object = b.Obj and Ver.Created = b.Cre
> ) c on Ver.Object = c.Object
>
> Thanks for your help
> Stefan Olofsson

www.psoug.org
Click on Morgan's Library
Click on Update

There are examples there that show how to do it.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Tue Apr 17 2007 - 10:38:27 CDT

Original text of this message

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