【IT168 服务器学院】首先编辑一个脚本文件,比如命名为abc.sh
spool abc.txt; #将结果输出为abc.txt
select * from wap_subscribe where Telcomcompanyid = ''20200'' and (Orderdate like ''2005%'' or Disorderdate like ''2005%'');
spool off;
在sql>模式下使用@/opt/abc.sh即可,查询结果即输出到abc.txt了