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

2024-11-20 19:33:16
推荐回答(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只是把这些命令放到一起了