SELECT
A.diary_id,
A.diary_name,
A.diary_contents,
A.create_user,
TO_CHAR(A.create_date, 'YYYY年MM月DD日 HH24:MI') AS create_date,
A.update_user,
TO_CHAR(A.update_date, 'YYYY年MM月DD日 HH24:MI') AS update_date,
B.user_name AS create_user_name,
C.user_name AS update_user_name
FROM user_diary A
INNER JOIN user_info B ON A.create_user = B.user_id
INNER JOIN user_info C ON A.update_user = C.user_id
WHERE B.delete_flag='0' AND B.status_id='1' AND C.delete_flag='0' AND C.status_id='1' AND A.update_user=11645
ORDER BY diary_id DESC