1.在没有设置默认值的情况下:
SELECT userinfo.id, user_name, role, adm_regionid, region_name , create_timeFROM userinfoLEFT JOIN region ON userinfo.adm_regionid = region.id
设置显示默认值:
SELECT userinfo.id, user_name, role, adm_regionid, IFNULL(region_name,0) as region_name, create_timeFROM userinfoLEFT JOIN region ON userinfo.adm_regionid = region.id