select ad.name , COUNT(zimage_size), MAX(build_date) -- MAX(case when zimage_size is null then '1970-01-01' else build_date end) from armlinux_defconfig ad, armlinux_build ab where ad.armlinux_buildid = ab.id group by ad.name