SELECT
	id,
	1 as rev_number,
	input_date,
	carry_remain_date as target_date,
	35 as user_id,
	19 as section_id,
	dealer_id as customer_id,
	dealer_group_id as customer_group_id,
	credit_timing_id as credit_timing_code,
	cutoff_date as cutoff_date_code,
	1 as currency_type_code,
	total_carry,
	close_flag_id as state_code,
	carry_remain_note as note,
	0 as invalid_flag_code,
	NULL as deleted_at,
	NOW() as created_at,
	NOW() as updated_at
FROM carry_remains
INTO OUTFILE "/tmp/receivable_carry_remains.csv" FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"';