ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
楼主: BIN_YANG168

[原创] SQL-多工作簿汇总

  [复制链接]

TA的精华主题

TA的得分主题

发表于 2015-11-17 16:55 | 显示全部楼层
本帖已被收录到知识树中,索引项:多表合并和汇总
终于学会用上SQL语句 谢谢分享

TA的精华主题

TA的得分主题

发表于 2015-11-19 13:11 | 显示全部楼层
select "车间1", * FROM [D:\关于多工作表汇总做数据透视时的字段显示问题\车间1`.`车间1$] UNION ALL
怎么理解这语句,如果是一个一个excel中多个sheet表。如:1月,2月。。。。12月,取值A-E列数据,怎么写代码

TA的精华主题

TA的得分主题

发表于 2015-12-2 18:32 | 显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
学习了,谢谢

TA的精华主题

TA的得分主题

发表于 2015-12-16 14:06 | 显示全部楼层
我现在的情况是这样的:生产线自动采集系统每天会生产若干工作簿,而且生产的每一个工作簿名称还不一样但名称是按“五位数字-字母数字组合-特殊字符数字中文组合”的规则命名的,也就是自动生成的每一个工作簿名称都不一样,但每个工作簿里面的工作表格式完全一样。我想要把这些成千上万个自动生成的工作簿里面的每一行数据都复制到一个总表里面,该怎么做呢?注意:我不是要汇总计算,只是要把每一个表里面的数据复制粘贴到总表里面,每天自动动态更新就可以了。

TA的精华主题

TA的得分主题

发表于 2016-1-6 15:33 | 显示全部楼层
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`3$A2:H] where 申请人 is not null union all
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`4$A2:H] where 申请人 is not null union all
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`5$A2:H] where 申请人 is not null union all
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`6$A2:H] where 申请人 is not null union all
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`7$A2:H] where 申请人 is not null union all
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`8$A2:H] where 申请人 is not null union all
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`9$A2:H] where 申请人 is not null union all
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`10$A2:H] where 申请人 is not null union all
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`11$A2:H] where 申请人 is not null union all
select "2011 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2011 烧焊单一览表`.`12$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`1$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`2$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`3$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`4$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`5$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`6$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`7$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`8$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`9$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`10$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`11$A2:H] where 申请人 is not null union all
select "2012 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2012 烧焊单一览表`.`12$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`1$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`2$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`3$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`4$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`5$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`6$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`7$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`8$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`9$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`10$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`11$A2:H] where 申请人 is not null union all
select "2013 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2013 烧焊单一览表`.`12$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`1$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`2$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`3$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`4$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`5$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`6$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`7$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`8$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`9$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`10$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`11$A2:H] where 申请人 is not null union all
select "2014 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2014 烧焊单一览表`.`12$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`1$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`2$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`3$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`4$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`5$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`6$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`7$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`8$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`9$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`10$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`11$A2:H] where 申请人 is not null union all
select "2015 烧焊单一览表", * FROM [C:\Users\Administrator\Desktop\模具烧焊单记录\2015 烧焊单一览表`.`12$A2:H] where 申请人 is not null

最后提示查询过于复杂 现在该怎么办

TA的精华主题

TA的得分主题

发表于 2016-1-8 12:47 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2016-3-3 16:43 | 显示全部楼层
楼主真真的是高人,只有学习膜拜了。坚持 学飞吧!!!!

TA的精华主题

TA的得分主题

发表于 2016-6-20 13:46 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2017-2-27 08:31 | 显示全部楼层

TA的精华主题

TA的得分主题

发表于 2017-7-27 13:30 | 显示全部楼层
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-6-9 13:21 , Processed in 0.043386 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表