批处理*.bat 执行mysql语句怎么写
我想写一个bat文件来执行写好的mysql命令不知道改怎么写mysql命令如下:truncatetablea_rank;insertintoa_rank(usersn,t...
我想写一个bat文件来执行写好的mysql命令 不知道改怎么写mysql命令如下:truncate table a_rank;insert into a_rank(usersn,totalpoint,point) select usersn,0,Ji from ccc order by Ji desc limit 99;update a_rank set usernick=(select usernick from b.userinfo where usersn=a_rank.usersn);truncate table a_rank;我需要的bat就是打开bat文件 就能自动执行这个MYSQL命令语句
展开
展开全部
@echo off
if not exist d:\rank.sql more +5 %0>d:\rank.sql
echo >nul
mysql -h localhost -u root -p 123456 < d:\rank.sql
goto :eof
truncate table a_rank;
insert into a_rank(usersn,totalpoint,point) ;
select usersn,0,Ji from ccc order by Ji desc limit 99;
update a_rank set usernick=(select usernick from b.userinfo where usersn=a_rank.usersn);
truncate table a_rank;
if not exist d:\rank.sql more +5 %0>d:\rank.sql
echo >nul
mysql -h localhost -u root -p 123456 < d:\rank.sql
goto :eof
truncate table a_rank;
insert into a_rank(usersn,totalpoint,point) ;
select usersn,0,Ji from ccc order by Ji desc limit 99;
update a_rank set usernick=(select usernick from b.userinfo where usersn=a_rank.usersn);
truncate table a_rank;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |