SELECT
	sd.id as id,
	sd.shipping_id as shipping_id,
	sd.shipping_sub_code as seq_number,
	ps.product_category_id as product_category_id,
	sd.product_set_id as product_set_id,
	sd.product_model_id as product_id,
	sd.lot_number as lot_number,
	'' as serial_number,
	sd.ubd_date as ubd,
	24 as validity_period,
	1 as unit_code,
	sd.shipping_quantity as quantity,
	sd.shipping_quantity as scheduled_quantity,
	sd.shipping_detail_note as note,
	NOW() as created_at,
	NOW() as updated_at
FROM shipping_details as sd
LEFT JOIN master_app_production.product_sets as ps
	ON sd.product_set_id = ps.id
INTO OUTFILE "/tmp/shipping_details.csv" FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"';