根據本司業務需求,將programid寫在txt中做爲查詢條件,發現數據庫中還有相同programid不一樣taskid的數據條目,因而寫個小腳本。mysql
#!/bin/bashfor i in cat /tmp/piandan.txt;domysql -uroot -pXXX -e "delete from database.tables where program_id = '$i' and createDatetime like '2019%';"donesql
cat /tmp/piandan.txt