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

Home -> Community -> Usenet -> c.d.o.server -> update from table prob

update from table prob

From: <pdiesner_at_my-deja.com>
Date: Mon, 18 Oct 1999 16:33:34 GMT
Message-ID: <7ufi4u$o0s$1@nnrp1.deja.com>


Hi folks,
take a look at this:

select count(*) from temp

result: 1700

select count(*) from temp t, person p where t.person_id = p.person_id;

result: 1700

select sum(count(*)) from person
group by person_id having count(*) = 1

result: 2500

update person p set p.a_date =
(select to_date('31.12.1997', 'DD.MM.YYYY') from temp where person_id =
p.person_id)

2500 rows updated !!!

How can this be ? I'm expecting, that the update-query updates all rows in table person with an person_id that occurs in table temp
(1700

rows).
But obviously all rows (2500) in table person are updated.

Any ideas / suggestions ?

Thanks

Peter

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Oct 18 1999 - 11:33:34 CDT

Original text of this message

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