I have a table that contains mostly zero entries but has a few
non-zero values scattered randomly in the table as VERSION 1 below.
What I want to do is fill in the zeroed values with copies of the
non-zero values resulting in the modified version of the table as
shown in VERSION 2 below.
In other words, I want to replicate entries following the entries as
originally supplied.
I would like someone to supply me with the MySQL code that can do this
or point me at an example of it.
CREATE TABLE `table1` (
`record_number` int(8) NOT NULL auto_increment,
`field_A` int(11) default NULL,
PRIMARY KEY (`record_number`),
UNIQUE KEY `record_number` (`record_number`)
) TYPE=MyISAM
VERSION 1
1 0
2 0
3 0
4 99
5 0
6 0
7 0
8 0
9 33
10 0
11 0
12 0
VERSION 2
1 0
2 0
3 0
4 99
5 99
6 99
7 99
8 99
9 33
10 33
11 33
12 33
Thanks very much for your help.