How can i do the following with 4.0?

delete fom t1 where id in (select id from t1 where usr_id = 10 order
by date_inserted  limit 4,999)

The ideia is to limit to 4 rows with the same usr_id value before i do
an new insert with that user_id. Ending up with only 5 rows.

I'm trying to not do a select with the Id's and dates and then sending
the delete queries. But i'm clueless on how to do this being stuck to
4.0. Appreciate any hints.

Thanks,
Gabriel

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to