MySQL的sql語句取shell程序中的forin多變量一例

#!/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]}

網(wǎng)站欄目:MySQL的sql語句取shell程序中的forin多變量一例
分享地址:http://bm7419.com/article24/giphce.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供自適應(yīng)網(wǎng)站、軟件開發(fā)、營銷型網(wǎng)站建設(shè)、標(biāo)簽優(yōu)化全網(wǎng)營銷推廣、小程序開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營