select a.c1,a.c2, b.c1,(select c4 from bbb where c1=b.c1 and c2=b.c2) as c4from aaa a , (select max(c1) as c1,c2 from bbb where c4 is not null group by c2) b
where a.c1=b.c2
where a.c1=b.c2
调试欢乐多
from aaa a ,(select max(id) as id,报案号 from bbb where 转出时间 is not null group by 报案号) b where a.报案号=b.报案号