【问题标题】:How do I join two tables in cognos with out any duplicate rows?如何在没有任何重复行的情况下连接 cognos 中的两个表?
【发布时间】:2018-02-20 21:01:45
【问题描述】:

我有一个用 ibm db2 sql 编写的查询,我想在 cognos 框架工作管理器 (FWM) 中使用它。该查询使用与其他表的多个连接,并在多个硬编码日期连接。我想在 FWM 中加入查询而不考虑日期逻辑,但我担心它可能会创建多行。如何加入?

select ,emp_id,paid_amount ,outstanding_amt
from employees_tab e
join  reserve_table  c
on c.emp_id = e.emp_id
and  effective _date <'2018-01-01' and (end_date is null or end_date >= '2018-02-01'

【问题讨论】:

  • 你的sql查询错误,去掉多余的逗号。

标签: sql sql-server date db2 cognos-10


【解决方案1】:

试试看:

select emp_id, paid_amount ,outstanding_amt
from employees_tab e
join  reserve_table  c
on c.emp_id = e.emp_id
where effective _date <'2018-01-01' and (end_date is null or end_date >= '2018-02-01');

【讨论】:

    猜你喜欢
    • 2013-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-28
    • 2012-03-25
    • 1970-01-01
    • 2011-05-19
    相关资源
    最近更新 更多