mysql的操作命令收集
复制表结构后复制数据
CREATE TABLE target_db.my_table LIKE source_db.my_table;
INSERT INTO target_db.my_table SELECT * FROM source_db.my_table;
批量修改特定日期数据
update fruit_table set total = total - 0.399 where date(create_time) ="2024-10-29"
联表匹配特定id的数据并修改
update fruit_delivery_qr_staff set net_weight = net_weight - 0.399 where delivery_qr_id in (select id from fruit_delivery_qr where date(create_time)="2024-10-29")
mysql简洁输出数据
mysql -u root -p --skip-column-names -e "select * from table" nacos -B
--skip-column-names 去掉输出的表头
-B 去掉输出的表框
nacos为指定的库名称
剩下的就是纯数据