Check out example codes for "insert into mysql subquery". It will help you in understanding the concepts better.

Code Example 1

INSERT INTO qa_costpriceslog (item_code, invoice_code, item_costprice)
  SELECT
    /* Literal number values with column aliases */
    1 AS item_code,
    2 AS invoice_code,
    item_costprice
  FROM qa_items 
  WHERE item_code = 1;

Learn ReactJs, React Native from akashmittal.com