Insert data into tables

Georgina

Member
Hi

Sorry if this is complex, but I am brand new to Pl/SQl and need some help please!

I have 2 tables - vehicle and warranty. Both of these tables have veh_ref_no as unique fields which I can link together to find the registration number (from vehicle) and the warranty plan (from Warranty) where the data exists on both tables.

What I now want to do is to find all the records that do not have a warranty plan, and to update the warranty_id field from the warranty table so that all the vehicle records have a warranty plan.

Can someone point me in the right direction please.

Thanks very much for any help

Georgina
 
At the risk of doing your homework for you

update table1 t1
set t1.fld1 = ( select t2.flda
from table2 t2
where )
where t1.fld2 is null;
 
Back
Top