informer30
MIS
Hi All,
I have a union query and in the first select statement I want to a coloumn as a reference which has no reference to the 2nd select statement...
How do I do that?
Select DUMMY.Ref, sum (AMOUNT) as AMOUNT
FROM
(select (SUBSTR (transfer_ref, 4, 10)) Ref,
(AMOUNT*-1)as AMOUNT
from Employee.Reference
union
select to_char((request_id)) as Ref,
AMOUNT as AMOUNT
from Old_Employee.Reference
)DUMMY
group by Ref
having sum (AMOUNT) <> 0
Many Thanks
I have a union query and in the first select statement I want to a coloumn as a reference which has no reference to the 2nd select statement...
How do I do that?
Select DUMMY.Ref, sum (AMOUNT) as AMOUNT
FROM
(select (SUBSTR (transfer_ref, 4, 10)) Ref,
(AMOUNT*-1)as AMOUNT
from Employee.Reference
union
select to_char((request_id)) as Ref,
AMOUNT as AMOUNT
from Old_Employee.Reference
)DUMMY
group by Ref
having sum (AMOUNT) <> 0
Many Thanks