|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
试着简化一下,但没有条件验证- SELECT * FROM (
- SELECT 'EO' AS 客户,ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[EO$] UNION ALL
- SELECT 'IF',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[IF$] UNION ALL
- SELECT 'KG',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[HK_KG$] UNION ALL
- SELECT 'KG',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[USA_KG$] UNION ALL
- SELECT 'JP',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[JP$] UNION ALL
- SELECT 'SL',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[SL$] UNION ALL
- SELECT 'TM',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[TM$] UNION ALL
- SELECT 'WW',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[WW$] UNION ALL
- SELECT 'TY',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[TY$] UNION ALL
- SELECT 'WO',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[WO$] UNION ALL
- SELECT 'KA',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[KA$] UNION ALL
- SELECT 'TI',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[TI$] UNION ALL
- SELECT 'NK',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[NK$] UNION ALL
- SELECT 'MT',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[MT$] UNION ALL
- SELECT 'WD',ITEM,PRICE,QTY,WEEKLY FROM `I:\Weekly Loading Report-WK02`.[WD$])
- WHERE WEEKLY LIKE 'WK__'
复制代码 如果各数据源表中只有ITEM,PRICE,QTY,WEEKLY这四列,则为- SELECT * FROM (
- SELECT 'EO' AS 客户,* FROM `I:\Weekly Loading Report-WK02`.[EO$] UNION ALL
- SELECT 'IF',* FROM `I:\Weekly Loading Report-WK02`.[IF$] UNION ALL
- SELECT 'KG',* FROM `I:\Weekly Loading Report-WK02`.[HK_KG$] UNION ALL
- SELECT 'KG',* FROM `I:\Weekly Loading Report-WK02`.[USA_KG$] UNION ALL
- SELECT 'JP',* FROM `I:\Weekly Loading Report-WK02`.[JP$] UNION ALL
- SELECT 'SL',* FROM `I:\Weekly Loading Report-WK02`.[SL$] UNION ALL
- SELECT 'TM',* FROM `I:\Weekly Loading Report-WK02`.[TM$] UNION ALL
- SELECT 'WW',* FROM `I:\Weekly Loading Report-WK02`.[WW$] UNION ALL
- SELECT 'TY',* FROM `I:\Weekly Loading Report-WK02`.[TY$] UNION ALL
- SELECT 'WO',* FROM `I:\Weekly Loading Report-WK02`.[WO$] UNION ALL
- SELECT 'KA',* FROM `I:\Weekly Loading Report-WK02`.[KA$] UNION ALL
- SELECT 'TI',* FROM `I:\Weekly Loading Report-WK02`.[TI$] UNION ALL
- SELECT 'NK',* FROM `I:\Weekly Loading Report-WK02`.[NK$] UNION ALL
- SELECT 'MT',* FROM `I:\Weekly Loading Report-WK02`.[MT$] UNION ALL
- SELECT 'WD',* FROM `I:\Weekly Loading Report-WK02`.[WD$])
- WHERE WEEKLY LIKE 'WK__'
复制代码 如果就在本工作簿中建立此查询
那么 `I:\Weekly Loading Report-WK02`. 全部替换为空
[ 本帖最后由 livewire 于 2010-4-18 10:35 编辑 ] |
|