1.
select
*
from
(
2.
select
product_id,
'ยกมา'
as
description, last_update, balance, 0
as
product_in, 0
as
product_out
from
balance
where
product_id=
'1234'
3.
union
all
4.
select
product_id,
'ซื้อสินค้่า'
, buydate , 0, quantity, 0
from
`สินค้าเข้า`
where
product_id=
'1234'
5.
union
all
6.
select
product_id,
'ขายสินค้า'
, saledate , 0, 0, quantity
from
`สินค้าออก`
where
product_id=
'1234'
7.
)
as
t
order
by
last_update