Hi All
I have a very weird situation, which i cant understand. Please help me out. Below is my problem scenario.
I have 2 queries having a UNION between them
select
COMPANY DEPARTMENT NATURAL_ACCOUNT LOCATION CONTRACT INTERCOMPANY FUTURE1 FUTURE2 ASSIGNMENT_ACTION_ID DEBIT CREDIT
from my_tables
where my conditions
and my checks
UNION
select
COMPANY DEPARTMENT NATURAL_ACCOUNT LOCATION CONTRACT INTERCOMPANY FUTURE1 FUTURE2 ASSIGNMENT_ACTION_ID DEBIT CREDIT
from my_tables
where my other conditions
and my other checks
Now the upper query returns 3 records while the lower query doesn't return any records (for certain set of parameters). The output in this case using UNION shows only 2 records (omitting the last record). I confirmed this by replacing the second query with the below query
UNION
select
null COMPANY null DEPARTMENT null NATURAL_ACCOUNT null LOCATION null CONTRACT null INTERCOMPANY null FUTURE1 null FUTURE2 null ASSIGNMENT_ACTION_ID null DEBIT null CREDIT
from dual
I cant use UNION ALL because its against my interest for the other set of parameters. Please help me out, why last record gets ignored or omitted
Regards