Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Query from SQL SErver
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. Received on Thu Oct 10 2002 - 11:36:29 CDT