The max and min worked. Thank you.

From: MN <mirek1_at_hotmail.com>
Date: Thu, 3 Dec 1998 09:45:12 -0500
Message-ID: <746863$6bl_at_news1.sjc.in.sel.sony.com>


Pawe3 Plichta wrote in message <7460gg$okv$1_at_info.nask.pl>...
>Try
>...
>select max(pin) from phonebook where
>phonebook.firstname=addressbook2.firstname
>....
>
>Do you know , which record is correct?
>
>Use max or min - if your base is consistent, max(pin)=min(pin) ????
>
>
>
>MN napisał(a) w wiadomości: <7445ov$duv_at_news1.sjc.in.sel.sony.com>...
>>I'm trying compare two table in Oracle and with a firstname and lastname
>>matches fill-in a pager pin number.
>>
>>This is the sql statement I'm running
>>
>>update addressbook2 set pin =
>>(select pin from phonebook where
phonebook.firstname=addressbook2.firstname
>>and
>>phonebook.lastname=addressbook2.lastname)
>>where addressbook2.firstname IN (select firstname from phonebook)
>>and addressbook2.lastname IN (select lastname from phonebook)
>>
>>but I get an error message saying:
>>ORA-01427: single-row subquery returns more than one row
>>
>>My question is can I update the table even when there are duplicates in
>>the tables. The query runs perfect when both tables are unique.
>>
>>Thank you for any help.
>>
>>MN
>>
>>
>
Received on Thu Dec 03 1998 - 15:45:12 CET

Original text of this message