shell mysql 查询 赋值 统计

来源:互联网 发布:hadoop php开发 编辑:程序博客网 时间:2024/06/01 08:58

 

#!/bin/bash

total=0
for (( i=0; i<101; i=i+1 ))
do

     cnt=`/usr/local/mysql/bin/mysql -h127.0.0.1 -uroot -p123456 test -N  -e "select count(distinct(uin)) from test$i"`
     echo $cnt
     total=`expr $total + $cnt`
done

 

echo total


原创粉丝点击