I am trying to created a table from a few columns from two other tables. I want this table to get data from the other two tables.
This is what I have so far
insert into crm_customer_coupon (barcode, customer_id,customer_name, coupon_name, number_of_times_used, product_sku)
select barcode, name, sku
Inner left Join crm_customer_extra_information where customer_id = 88
id: Barcode: Name : Description: Type : Amount : sku
id : name: customer_id : ect...
barcode: customer_id : customer_name: coupon_name: product_sku
insert into crm_customer_coupon (barcode,name,sku) select crm_coupons.barcode, crm_customer_extra_information.coupon_name, crm_coupons.sku From crm_coupons left Join crm_customer_extra_information on crm_coupons.id=crm_customer_extra_information.id where customer_id = 88
You forgot to mention you join field (i guess it's id), also you didn't mention which name field you want to insert , i put coupon_name , you can change the filed name in the subquery select