Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update Table from another table

zephyr223Aug 2 2012 — edited Aug 2 2012
Hi All,
I am trying to update table a's date column with the existing date column from from table , so i write a query like this.


update tbl_traffic_citation a
set a.insertdate= (select b.insertdate from tbl_traffic b
where a.id= b.id

I get the following error ORA-01427 - single-row subquery returns more than one row. I know this error is due to the fact that TBL_TRAFFIC can have multiple records of the same ID, whereas TBL_TRAFFIC_CITATION will have one record. So i guess how question is, how can i join the two tables using distinct? I hope this makes some sense.
Thanks in advance
This post has been answered by John Spencer on Aug 2 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 30 2012
Added on Aug 2 2012
4 comments
878 views