excel中的db2 sql查询
我为团队中的其他人运行了许多非常简单的查询,并将它们放入 Excel 中,以便最终用户可以通过打开电子表格自行执行查询。
我当前正在使用 ODBC 驱动程序连接到 DB2 服务器。
所有查询都工作正常,但有一个查询让我在 Excel 中正确工作时感到头疼。
其中一个查询有一个 where 语句,该语句根据情况等于不同的值。
前任。
SELECT *
FROM TABLE1 T1
WHERE T1.T1_ID = 859745
我想要的是将其设置为查询运行如下。是否可以通过变量以某种方式做到这一点?
SELECT *
FROM TABLE1 T1
WHERE T1.T1_ID = "USER ENTERED VALUE FROM COLUMN A ROW 1 IN THE EXCEL SHEET"
I have a number of very simple queries that I run for others on my team and am placing them in Excel so that the end user can just execute the query themselves by opening the spreadsheet.
I'm currently using an ODBC driver to connect to the DB2 server.
All queries work fine but one is giving me a headache in getting it to work correct in Excel.
One of the queries has a where statement that equals a different value depending on the situtation.
ex.
SELECT *
FROM TABLE1 T1
WHERE T1.T1_ID = 859745
What I would like is to set it up so that the query runs like the following. Is it possible to do this through a variable somehow?
SELECT *
FROM TABLE1 T1
WHERE T1.T1_ID = "USER ENTERED VALUE FROM COLUMN A ROW 1 IN THE EXCEL SHEET"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您使用的是 Microsoft Query。首先向查询添加一个参数。然后您可以自定义您的参数 选择一个 Excel 单元格和参数的输入
I'm assuming you're using Microsoft Query. First add a parameter to the query. Then you can customize your parameter to choose an excel cell an the input for the paramter