SELECT
name,
time
FROM
zcl a
WHERE
EXISTS
(SELECT 1 from zcl b WHERE a.time>b.time null and a.name=b.name)
or
(SELECT 1 from zcl c WHERE a.name=c.name GROUP BY a.name HAVING count(c.name)=1)
SELECT
name,
time
FROM
zcl a
WHERE
EXISTS
(SELECT 1 from zcl b WHERE a.time>b.time null and a.name=b.name)
or
(SELECT 1 from zcl c WHERE a.name=c.name GROUP BY a.name HAVING count(c.name)=1)