MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.
Select A.dc,A.rc,B.acctno, ((Sum(If(B.ttc In ('X','Y','Z'), 0, B.ua))) - (Sum(If(B.ttc In ('X','Y','Z'), B.ua, 0)))) As Total_UA, (Sum(C.cub)) As Total_CUB From Table_B As B Left Join Table_C As C On B.acctno = C.acctno Left Join Table_A As A On B.acctno = A.acctno Where A.status != 'C' Group By B.acctno Having Abs(Total_UA - Total_CUB) > 0.0001
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.