I have results from select statement,but i need to insert the result into another table.How to archieve this on mysql or php?
Select statement :
SELECT a.*,MONTH(bd.tarikh) bulan,tahun
FROM
(
SELECT bl_ic_pesawah ic,bl_name name,bl_musim musim,bl_zon_id zon,bl_nettWeight nettWeight,
CASE
WHEN bl_nettWeight BETWEEN be_rangef AND be_ranget THEN be_quantity
WHEN bl_nettWeight >= be_morethan THEN be_quantity_1
WHEN bl_nettWeight = be_morethan_sws THEN be_quantity_sws
ELSE NULL END AS layak,
be.be_date_from date_from,be_date_to date_to
FROM b_ledger
LEFT JOIN b_entitle be ON bl_musim = be_season AND bl_zon_id = be_zid
WHERE be.be_status='Buka' AND bl_id = 1
) a
LEFT JOIN b_date bd ON bd.tarikh BETWEEN a.date_from AND a.date_to
GROUP BY MONTH(bd.tarikh),a.ic
After inserted into table it will be something like this:


Insert into `another_table` SELECT a.*, ....