UPDATE pay_method_basic_info ft INNER JOIN ( SELECT channel_id, method_id, IF ( @channelId = t.channel_id, @row_num := @row_num + 1, @row_num := 1 ) AS row_num, @channelId := t.channel_id FROM pay_method_basic_info t ) mt ON ft.channel_id = mt.channel_id AND ft.method_id = mt.method_id SET ft.method_id = ft.channel_id * 100 + row_num
相关文章
- 11-28mysql实现分组和组内序号
- 11-28mysql 按组内顺序 分配序号