简体   繁体   English

如何将SQL脚本文件导出到Excel列

[英]How to export SQL script file into Excel column

I have a SQL script file suppose student.sql (placed somewhere) like: 我有一个SQL脚本文件,假设student.sql (放在某个地方)像:

update student set sname='xyz' where RollID='101';

update student set sname='axz' where RollID='102';

I want to export value of sname and RollID into on Excel on column wise for each rows. 我想将snameRollID值导出到Excel中每行的列中。

How to export the column values. 如何导出列值。 Kindly help, I will highly solicited to you. 敬请帮助,我将高度欢迎您。

U can try "Find" to locate the position, and "MID" to cut text. 您可以尝试“查找”找到位置,并尝试“ MID”剪切文本。

eg (assuming a sql update student set sname='xyz' where RollID='101'; is put in cell A1) 例如(假设一个sql更新学生集sname ='xyz',其中RollID ='101';放在单元格A1中)

=FIND("sname=",A1,1)+7 - means the begining position of xyz (7 means length of sname='), assuming this formula is put in B1 = FIND(“ sname =”,A1,1)+7-表示xyz的开始位置(7表示sname ='的长度),假设此公式放在B1中

=FIND("' where Roll", A1) - means the ending position of xyz, assuming this formula is put in C1 = FIND(“'其中Roll”,A1)-表示xyz的结束位置,假设此公式位于C1中

then, the below formula give you xyz =MID(A1, B1,C1-B1) 然后,下面的公式为您xyz = MID(A1,B1,C1-B1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM