このクエリを試してください -
(編集例)
CREATE TABLE opencall(
company INT(11) DEFAULT NULL,
closedate DATE DEFAULT NULL
);
-- Populate table, only company=4 has old reecords.
INSERT INTO opencall VALUES
(1, '2012-09-18'),
(1, '2012-06-05'),
(1, '2012-08-18'),
(2, '2012-09-13'),
(2, '2012-08-04'),
(4, '2012-05-12'),
(4, '2012-04-11');
SELECT t1.company, t1.closedate FROM opencall t1
JOIN (SELECT company, MAX(closedate) max_closedate
FROM opencall
GROUP BY company
HAVING max_closedate < CURDATE() - INTERVAL 60 DAY
) t2
ON t1.company = t2.company;
+---------+------------+
| company | closedate |
+---------+------------+
| 4 | 2012-05-12 |
| 4 | 2012-04-11 |
+---------+------------+