यदि आप प्रति तिथि एक से अधिक प्रविष्टियाँ प्राप्त करते हैं, तो आप कुछ व्युत्पन्न तालिकाओं में शामिल होना छोड़ सकते हैं
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;