Q:

mysql select from multiple table

I have 3 tables with values like below
**tbl_product**
recID      pID       price      colour
1         BDPLA-0001   1.23        White
2         BDPLA-0002   2.23        Black
3         BDPLA-0003   2.28        Blue

tbl_product_size
recID        pID       size       stock       
1            1         2.0cm       10 
2            1         3.0cm       20
3            2         2.5cm       30
4            3         3.6cm       40
5            3         3.8cm       50

tbl_order_details
recID       pID        quantity   size
201         BDPLA-0001   5        2.0cm 
202         BDPLA-0002   10       2.5cm

tbl_product = t
tbl_product_size = s
tbl_order_details = d

t.recID = s.pID
t.pID = d.pID

how can i combine the tables and produce result like this
t.pID       s.size       s.stock     d.quantity  t.price
BDPLA-0001  2.0cm        10          5           1.23
BDPLA-0001  3.0cm        20          null        1.23
BDPLA-0002  2.5cm        30          10          2.23
BDPLA-0003  3.6cm        40          null        2.28
BDPLA-0003  3.8cm        50          null        2.28

A:

You can use an union for that.
select a,b,c from table A
union
select a,b,c from table B;

The number and type of columns in each select should be the same.

