【发布时间】:2018-06-13 15:14:09
【问题描述】:
我是一个 excel sql 访问查询,它连接一些字段,然后使用 where 子句缩小数据集。我有很多 where 子句,我想知道是否可以将带有标题/范围的工作表名称声明为我的 where 子句,而不是使用 +100 where 字符串列表。
我的查询是,
select b.*
from (Select B.*, B.[RF attribute1] & "|" & B.[RF attribute2] & "|" & B.[RF attribute3] & "|" & B.[RF attribute4] as new_field
from [BlackMonday1987$] as B
) as b
where new_field in ('a','b','c')
但是我该怎么做,这个子句将使用工作表 1 上 header1 中的所有字段。我已经尝试了下面的方法,不确定它是否可以完成,或者它的逻辑是否正确。
where new_field = [Sheet1$].[header1]
【问题讨论】: