@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;
按平常写就行,bat只是把这些命令放到一起了