Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: MS SQL Server syntax to Oracle
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.orgReceived on Tue Apr 17 2007 - 10:38:27 CDT