select id as id,
       payto_supplier_id as payto_supplier_id,
       payto_supplier_group_id as payto_supplier_group_id,
       NULL as user_id,
       disp_name as disp_name,
       id as disp_sort,
       j_name as j_name,
       e_name as e_name,
       kana_name as kana_name,
       print_name_1 as print_name_1,
       print_name_2 as print_name_2,
       zip as zip,
       address_1 as address_1,
       address_2 as address_2,
       address_3 as address_3,
       tel as tel,
       fax as fax,
       title_code as title_code,
       NULL as delivery_zip,
       contact_name as contact_name,
       delivery_address_1 as delivery_address_1,
       delivery_address_2 as delivery_address_2,
       delivery_address_3 as delivery_address_3,
       delivery_tel as delivery_tel,
       delivery_fax as delivery_fax,
       attention_name as attention_name,
       attention_tel as attention_tel,
       attention_fax as attention_fax,
       currency_type_code as currency_type_code,
       duty_type_code as duty_type_code,
       duty_rate as duty_rate,
       price_duty_type_code as price_duty_type_code,
       CASE duty_calc_type_code WHEN 1 THEN 2 WHEN 2 THEN 1 WHEN 3 THEN 3 WHEN 4 THEN 4 ELSE NULL END as duty_calc_type_code,
       frac_digit_code as frac_digit_code,
       fraction_method_code as fraction_method_code,
       NULL as unit_price_fraction_method_code,
       fraction_method_code as price_fraction_method_code,
       order_sheet_type_code as order_sheet_type_code,
       NULL as account_number,
       note as note,
       IF(deleted_at is NULL, 0, 1) as invalid_flag_code,
       NULL as deleted_at,
       created_at as created_at,
       updated_at as updated_at
FROM suppliers
INTO OUTFILE "/tmp/suppliers.csv" FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\';
