Getting error below
Msg 422, Level 16, State 4, Line 9 Common table expression defined but not used.
with vals
as
(
select I_QTY as Iss From tbl_Issuance where I_Type='Issue'
union all
select I_QTY as Ret From tbl_Issuance where I_Type='Return'
)
select Iss - Ret as difference