Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: simple sql question
How about:
UPDATE table_a a
SET a.f1 = (
SELECT b.f1
FROM table_b
WHERE a.f2 = b.f2
AND ROWNUM = 1)
WHERE EXISTS (
SELECT 'X'
FROM table_b
WHERE a.f1 != b.f1
AND a.f2 = b.f2)
/
(It might help a lot if you had indexes on
table_a.f1 and table_b.f1)
susana73_at_hotmail.com wrote:
> I am an ingres developer and new in oracle. I have the following simple
> Ingres SQL and am wondering how to change it to SQL in Oracle. Thanks!
>
> UPDATE table_a a
> FROM table_b b
> SET f1 = b.f1
> WHERE a.f2 = b.f2
> AND a.f1 != b.f1;
>
> Susan
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Thu Jan 07 1999 - 16:15:17 CST
![]() |
![]() |