批处理*.bat 执行mysql语句怎么写

2024年11月20日 19:33
有2个网友回答
网友(1):

@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;

网友(2):

按平常写就行,bat只是把这些命令放到一起了