SAP Knowledge Base Article - Preview

2989279 - Queries have different result sets but they should be the same - SAP IQ

Symptom

The following is a scenario where queries have different result set, but the results should be the same.

======

1) Return 4 rows

select ta.id
from #ta ta
inner join #tb tb
on ta.id = tb.id;

id
--------------------
AAA
AAA
AAA
AAA


2) Return 4 rows

select ta.id
from #ta ta
inner join #tb tb
on ta.id =
case
when tb.id='X' then 'YYY'
when tb.id='X' then 'YYY'
else tb.id
end case;

id
--------------------
AAA
AAA
AAA
AAA


3) Does not return 4 rows


select ta.id
from #ta ta
inner join #tb tb
on ta.id =
case
when tb.id='X' then 'YYY'
else tb.id
end case;
go

 id
--------------------
AAA
AAA


Read more...

Environment

  • SAP IQ 15.4
  • SAP IQ 16.0
  • SAP IQ 16.1 

Product

SAP IQ 16.0 ; SAP IQ 16.1 ; SAP Sybase IQ 15.4

Keywords

query queries different wrong result set case inner join  CR 823410 CR823410 , KBA , BC-SYB-IQ , Sybase IQ , Bug Filed

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP ONE Support launchpad (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.