Path: news.easynews.com!newsfeed1.easynews.com!easynews.com!easynews!news-out.cwix.com!newsfeed.cwix.com!prodigy.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!34d3422d!not-for-mail
From: Karsten Farell <kfarrell@medimpact.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1) Gecko/20020826
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.server
Subject: Re: Query from SQL SErver
References: <fb04eea9.0210090923.6ed3a91a@posting.google.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 25
Message-ID: <h0ip9.2830$v81.165604469@newssvr14.news.prodigy.com>
NNTP-Posting-Host: 67.117.210.172
X-Complaints-To: abuse@prodigy.net
X-Trace: newssvr14.news.prodigy.com 1034267789 ST000 67.117.210.172 (Thu, 10 Oct 2002 12:36:29 EDT)
NNTP-Posting-Date: Thu, 10 Oct 2002 12:36:29 EDT
Organization: Prodigy Internet http://www.prodigy.com
X-UserInfo1: [[PGGX_EJ[U]CQ\Y\BCBNWX@RJ_XPDLMN@GZ_GYO^RR@ETUCCNSKQFCY@TXDX_WHSVB]ZEJLSNY\^J[CUVSA_QLFC^RQHUPH[P[NRWCCMLSNPOD_ESALHUK@TDFUZHBLJ\XGKL^NXA\EVHSP[D_C^B_^JCX^W]CHBAX]POG@SSAZQ\LE[DCNMUPG_VSC@VJM
Date: Thu, 10 Oct 2002 16:36:29 GMT
Xref: newsfeed1.easynews.com comp.databases.oracle.server:163743
X-Received-Date: Thu, 10 Oct 2002 09:37:06 MST (news.easynews.com)

PABLO wrote:
> Hi, I am trying to migrate this query from SQL server to Oracle 9i and
> I can not find a way to solve it.
> 
> Does someone have and idea of how to do it ?
> 
> Thanks a lot in advance.
> Pablo
> 
> UPDATE Table1
> SET FieldA = b.FieldB
> FROM ( SELECT Exp as FIledB, Exp as FieldC FROM ... WHERE.... ) As B
> WHERE Table1.FieldA <> b.FieldB
> AND   Table1.Field> >= b.fieldC

This is a common problem when a database vendor (or any other kind of 
software vendor) decides to "extend" a standard ... and then 
unsuspecting developers make use of those extensions ... like using 
Oracle's DECODE. The UPDATE ... FROM is a Sybase and SQLServer extension.

You have to move the conditions in your FROM clause to a subquery in 
your WHERE clause. I had to do a lot of these things one time when I 
worked for one of those dot-coms who used Sybase until Sony (who used 
Oracle) told them to switch or else. We switched.

