Anda dapat meninggalkan bergabung ke beberapa tabel turunan untuk berjaga-jaga jika Anda mendapatkan beberapa entri per tanggal
SELECT a.id_master ,
a.barcode ,
a.name ,
a.last_stock ,
COALESCE(b.`IN`, 0) AS `IN`,
COALESCE(c.`OUT`, 0) AS `OUT`
FROM master a
LEFT JOIN (SELECT barcode, SUM(qty) as `IN`
FROM trans_in
WHERE date(time_trans) = '2016-04-01'
GROUP BY barcode ) b ON a.barcode = b.barcode
LEFT JOIN (SELECT barcode, SUM(qty) as `OUT`
FROM trans_out
WHERE date(time_trans) = '2016-04-01'
GROUP BY barcode ) c ON a.barcode = c.barcode;