两张表联合查询,显示需要的信息
SELECT b.`NAME`,a.`USER_ID`,a.numFROM (select `USER_ID`,count(*) AS num from af_person_deposit_detail_mem group by `USER_ID`) a LEFT JOIN base_pc_user_info b on a.`USER_ID` = b.`USER_ID`;