Skip to content

Instantly share code, notes, and snippets.

@yangl
Last active June 1, 2016 09:42
Show Gist options
  • Save yangl/3d40e22e95f2fa8844b1a0812113c2af to your computer and use it in GitHub Desktop.
Save yangl/3d40e22e95f2fa8844b1a0812113c2af to your computer and use it in GitHub Desktop.
查询SQL并输出,动态拼表名
dd=`date -d yesterday "+%Y%m%d"`
sql="select count(1) c, status from t_customgift_${dd} where if_outapppush=1 group by status;"
mysql -h10.10.130.109 -ugrowth_log -pgrowth_uxin_com -Dgrowth -P3307 -e "${sql}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment