我在sql Developer(Oracle数据库)中有一个SQL查询,该查询运行良好并且返回4列和2条记录,但是如果我在Crystal报表的“添加命令”中使用相同的查询,它将返回空值。
p.Name(在模式1的DB中,数据类型为VARCHAR2(100 Char),例如:“ SAP Consulting LLC”)
TN.TNA(在模式1的DB中,数据类型为VARCHAR2(25个字符),例如:“ 123-456788”)
P.SUB(在模式1的DB中,数据类型为VARCHAR2(25个字符),例如:“ 0”)
P.M_NO(在模式1的DB中,数据类型为VARCHAR2(25个字符),例如:“ 123456”)
with ABC as (
select pnc.p_id from schema1.pp_pnc pnc, schema1.pp_n pn
where PNC.N_ID = PN.id
and PN.DS = 'ABC'
and PNC.END_DATE like '01-JAN-20'),
EFG as (select pnc.p_id from schema1.pp_pnc pnc, schema1.pp_n pn
where PNC.N_ID = PN.id
and PN.DS = 'EFG'
and PNC.END_DATE like '01-JAN-00')
select distinct P.name, TN.TNA, P.SUB , P.M_NO
from schema.PETA P
inner join SCHEMA1.ALPHA PTPC on P.id = PTPC.P_ID
inner join schema1.BETA TN on PTPC.TN_ID = TN.id
inner join ABC on P.id=ABC.P_ID
inner join EFG on P.id=EFG.P_ID
where PTPC.END_DATE > sysdate
and TN.TNA not in ('123-456788', '456-457896')