Update Table from another table
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