join with in clause from column mysql code example
Example 1: mysql join query
SELECT
m.member_id,
m.name member,
c.committee_id,
c.name committee
FROM
members m
INNER JOIN committees c
ON c.name = m.name;
Example 2: how to join result table in mysql
SELECT inv.product_id, inv_stock.stock
FROM inventories AS inv
JOIN
(SELECT product_id, stock
FROM inventories ) AS inv_stock
ON inv.product_id = inv_stock.product_id
;