首页 > 数据库技术 > 详细

shell中的Mysql查询

时间:2014-05-27 18:07:47      阅读:423      评论:0      收藏:0      [点我收藏+]

1 #!/bin/bash
2 #查询
3 echo -e 
4 for i in `cat id.txt`
5 do
6 A=`mysql -h10 -uw -p2012 -Ne "select Id,Name,User_Logindate from info where Id=$i"`;
7 B=`mysql -h10 -uw -p2012 -Ne "select ifnull(sum( Amount),0) from Info where Date between ‘2014-05-21‘
and ‘2014-05-22‘ and Id=$i and Res=1"`
8 echo -e "$A\t\t\t\t$B\t" >> tmp.xls;
9 done

shell中的Mysql查询,布布扣,bubuko.com

shell中的Mysql查询

原文:http://www.cnblogs.com/fupeng/p/3752913.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!