Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Creating Equal number of records based on a column.

$
0
0
Hi Guys,

The Table i am talking about it is as follows.

Col1 Col2 Col3 Col4

Col1 can have 5 different values (1,2,5,6,7).

Based on the Col2, i will see how many such values are present for Col1. Then i have to create the remaining records with col3 and col4 as '99'.

For an example,

1 AA 87 98
2 AA 77 56
6 BB yu io


So, for AA i have to add 3 more records, with value for the first record as 5,6,7 and the remaining col3 and col4 as '99'

For BB, we have to add 4 more records with value for the first record as 1,2,5,7 and the remaining col3 and col4 as '99'.

Can somebody help me out with this.

Cheers!!!

Viewing all articles
Browse latest Browse all 13329

Latest Images

Trending Articles



Latest Images