SELECT
	od.id as id,
	od.order_id as order_id,
	od.order_sub_code as seq_number,
	ps.product_category_id as product_category_id,
	od.product_set_id as product_set_id,
	od.product_model_id as product_id,
	'' as lot_number,
	'' as serial_number,
	NULL as ubd,
	NULL as validity_period,
	NULL as unit_code,
	od.order_quantity as quantity,
	od.order_price as price,
	NULL as stock_type_code,
	od.order_detail_note as note,
	NOW() as created_at,
	NOW() as updated_at
FROM order_details as od
LEFT JOIN master_app_production.product_sets as ps
	ON od.product_set_id = ps.id
WHERE od.order_id > 164
INTO OUTFILE "/tmp/order_details.csv" FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"';
