Created
February 17, 2016 03:03
-
-
Save staticor/adffb1865684afa0fdc3 to your computer and use it in GitHub Desktop.
mysql retrieve data in Shell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run_Mysql() | |
{ | |
mysql --default-character-set=utf8 \ | |
-h 192.168.156.120 \ | |
-u data -p'PIN239!@#$%^&8' \ | |
-D optimus \ | |
-e " | |
select platform, day | |
, SUM(bid) as bid , SUM(imp) as imp | |
, sum(click) as click | |
, sum(adv_cost) as cost | |
from report.rpt_effect_day | |
where day > ADDDATE(SYSDATE(), INTERVAL - 8 day) and platform = 'XiaoMi' | |
group by platform, day | |
order by day | |
" > output_mysql.data | |
} | |
run_Mysql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment