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
应该这样:
SELECT TAB_MEMBER_CARD.*,c.* 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
谢谢啦,是我没看仔细