SELECT member.id, member.nick_name, t_log_cash.point, t_log_cash.reg_time, (SELECT b.id FROM member b WHERE b.idx=member.recommend_member) AS 총판, u_business
FROM mydb.t_log_cash join member on t_log_cash.member_idx = member.idx
where t_log_cash.ac_code = 126 and t_log_cash.reg_time >= '2022-06-16 00:00:00' and t_log_cash.reg_time < '2022-07-01 00:00:00'