Hi,
I have 1 table with row data (No Primary Ky). and Another with Primary Key.
In row data table, i have multiple records on 3 perameters. And other 10 Field with same value in all the records on these 3 pereameters.
Eg.
aa bb cc dd ee ff gg hh ii p1 p2 p3 V1 V2 V3 V4
a1 b1 c1 d1 e1 f1 g1 h1 i1 zz 123 03-05-2009 5 2 3 4
a1 b1 c1 d1 e1 f1 g1 h1 i1 zz 123 03-05-2009 10 1 4 4
I want to insert in my table is like
aa bb cc dd ee ff gg hh ii p1 p2 p3 V1 V2 V3 V4
a1 b1 c1 d1 e1 f1 g1 h1 i1 zz 123 03-05-2009 15 3 7 8
Only one record group by column p1,p2,p3...
Can any one suggest me how to write SP For this??
I have defined one cursor with columns p1,p2,p3.
First i m checking that These type of record exists in master or not? as in my master table Primary key is based on these perameters.
Then i have written query with gorup by clause...??
But is it right way of doing it???
Please guide..
Thanks In Advance..