… | |
… | |
18 | branche |
18 | branche |
19 | )) { |
19 | )) { |
20 | my ($id, $count) = sql_fetch "select $col, count(*) from row group by 1 order by 2 desc limit 1"; |
20 | my ($id, $count) = sql_fetch "select $col, count(*) from row group by 1 order by 2 desc limit 1"; |
21 | warn "$col => ($id) * $count\n"; |
21 | warn "$col => ($id) * $count\n"; |
22 | next unless $id; |
22 | next unless $id; |
23 | warn "update $col set id = 0 where id = ?", $id; |
23 | sql_exec "update $col set id = 0 where id = ?", $id; |
24 | warn "update row set $col = 0 where $col = ?", $id; |
24 | sql_exec "update row set $col = 0 where $col = ?", $id; |
25 | } |
25 | } |
26 | |
26 | |