S
Shahzad
dear respected gurus,
I would like to knew how to apply append,insert query for a self table
where no primary keys issues.
i do have problem say there are 5 rows of single record, this is data
of motor under one policy. say policy is john2004, so john is owner of
5 cars. now on next year the card has got renew with same
conditions(same amounts all), so i need to insert new recocrd via
query in new policy is john2005, with same condition no change
as the policy renew at masters level but on child table does not
renew...
i have been trying since 3 days and last i decided to consult with my
GURUS
i did try a lots but does not works. like
=>insert into tblMotor values (Select * from tblMotor where
policyno="john2004" from tblmotor);
=>insert into tblMotor (Select * from tblMotor where
policyno="john2004");
NOTE: above two are wrong, as renew policy is coming from other system
and there are records in master but child is empty
=>insert into tblMotor (policyno,plateno,suminsured,premiuum)
values(policyno,plateno,suminsured,premiuum);
any hints or tips for self join queries will be appreciated
rgds
shahzad
I would like to knew how to apply append,insert query for a self table
where no primary keys issues.
i do have problem say there are 5 rows of single record, this is data
of motor under one policy. say policy is john2004, so john is owner of
5 cars. now on next year the card has got renew with same
conditions(same amounts all), so i need to insert new recocrd via
query in new policy is john2005, with same condition no change
as the policy renew at masters level but on child table does not
renew...
i have been trying since 3 days and last i decided to consult with my
GURUS
i did try a lots but does not works. like
=>insert into tblMotor values (Select * from tblMotor where
policyno="john2004" from tblmotor);
=>insert into tblMotor (Select * from tblMotor where
policyno="john2004");
NOTE: above two are wrong, as renew policy is coming from other system
and there are records in master but child is empty
=>insert into tblMotor (policyno,plateno,suminsured,premiuum)
values(policyno,plateno,suminsured,premiuum);
any hints or tips for self join queries will be appreciated
rgds
shahzad