SELECT TAB_MEMBER_CARD.*,Tab_MemberInfoDoc.* FROM dbo.TAB_MEMBER_CARD LEFT JOIN(select Tab_MemberInfoDoc.* from Tab_MemberInfoDoc join (SELECT max(id) as id from Tab_MemberInfoDoc group by member_id ) b on Tab_MemberInfoDoc.id=b.id) c on TAB_MEMBER_CARD.ID = c.member_id
相关分类