You almost had me there, but I don't think this will keep the maximum timestamp per day.SELECT * FROM agent_log t1 WHERE timestamp < now() - interval '7 days' AND timestamp < ( SELECT max(timestamp) FROM agent_log t2 WHERE t2.class=t1.class AND t2.promiser=t1.promiser AND t2.hostname=t1.hostname AND t2.ip_address=t1.ip_address ) ORDER by class,timestamp;
Neil Watson
watson-wilson.ca
In reply to Re^4: Help on selecting and deleting many records in a DB.
by neilwatson
in thread Help on selecting and deleting many records in a DB.
by neilwatson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |