MySQL的sql语句取shell程序中的for in多变量一例
发布时间:2022-03-26 11:00:00 所属栏目:MySql教程 来源:互联网
导读:#!/bin/bash a=(`cat time.txt`) b=(`cat sum.txt`) for (( i = 0; i 38; i++)) do /bin/mysql -u test -ptest -h localhost -P 3306 EOF update billing.test set scan_first_sum=${b[$i]} where project=zjpj and date=${a[$i]}; select * from chenfeng.t
#!/bin/bash a=(`cat time.txt`) b=(`cat sum.txt`) for (( i = 0; i < 38; i++)) do /bin/mysql -u test -p'test' -h localhost -P 3306 <<EOF update billing.test set scan_first_sum='${b[$i]}' where project='zjpj' and date='${a[$i]}'; select * from chenfeng.test where project='zjpj' and date='${a[$i]}' and scan_first_sum='${b[$i]}'; EOF done #echo ${a[$i]} ${b[$i]} (编辑:台州站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |