select id as id,
       login as login,
       id as disp_sort,
       disp_name as disp_name,
       j_name as j_name,
       e_name as e_name,
       NULL as kana_name,
       email as email,
       NULL as mmail,
       NULL as rank_id,
       NULL as user_id,
       NULL as path,
       0 as custom_path_flag_code,
       '92551b7d4fe6e8c9b8dc4cbe43680e3a661d1c6b' as crypted_password,
       '43d928302805ce3d199e9e4cc498e8d3f4009fc8' as salt,
       remember_token as remember_token,
       remember_token_expires_at as remember_token_expires_at,
       NULL as crypted_uid,
       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 users
INTO OUTFILE "/tmp/users.csv" FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\';
