echo select location, AVG(age) as average from location where location='%name%' >test.sql
当我想将一个简单的sql脚本写入文件时,我得到了错误" AS此时出乎意料"所以当我删除时,我得到了#34; FROM在这个时候是出乎意料的"。当我用双引号括起来时,它起作用,但我不想这样做
答案 0 :(得分:1)
尝试转义()
echo selecet location, AVG^(age^) as average from location where location='%name%' >test.sql