数据库 a表左连接b表,a中一条数据对应b中多条数据,如何只取b表中createDate最大的一条
CREATETABLEa(idINT)CREATETABLEB(cidINT,createDateDATETIME)INSERTINTOaSELECT1UNIONSELECT2INSERTINTObSELECT1,'2016-02-19'UNIONSELECT1,'2016-02-18'UNIONSELECT2,'2016-02-17'UNIONSELECT2,'2016-02-16'UNIONS