【发布时间】:2017-05-22 15:17:10
【问题描述】:
我有一个具有参数化日期值的 BTEQ 脚本。日期值是根据另一个选择查询设置的。如何执行选择查询以读取日期并在 BTEQ 脚本中使用 示例
从 table1 中读取 max(order_date)
选择 max(order_date) 作为 max_order_date 从表1
使用 BTEQ 中的 max_order_date
选择 max_order_date 作为 report_run_dt, .... 从表 2 ...
如何读取 max_order_paramter 并将其存储为要传递给 BTEQ 的日期参数
【问题讨论】:
-
如果您只需要在单个 Select 中使用该参数,您可以简单地将其嵌入:
select (select max(order_date) from table1) as report_run_dt, .... from table2 ...