Hi,

Thank you Laercio.

Hy Csongor,

You can write this in pure Mysql.

1. First you create a temporary table from your original table events with
group by remoteid and when;
2. Create your new table with the fields value_a, value_b and value_c;
3. Populate your new table from your temporary table with 0 in value_*
fields;


I guess this (3.) point was what I missed!

4. Update the value_* fields from the original table.

There may be a simpler way to do this, but I think this is the easyest one.


Actually I ended up like this:
1. mysqldump -T the table
2. wrote a perl script that created a few million "INSERT INTO... ON DUPLICATE KEY UPDATE..." lines, and fed it to mysql


The good thing is that now I have MySQL 4.1 :-)

Regards,
- Cs.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to