select sum(x.cnt) from (select count(1) as cnt from purinDt where goodsid = 'G096QYEZMBQ'
union all select count(1) as cnt from saleoutdt where goodsid = 'G096QYEZMBQ') x
union all select count(1) as cnt from saleoutdt where goodsid = 'G096QYEZMBQ') x