delete with an offset?

2005-10-21 Thread Eric Persson
Hi, Is it possible to delete from a table with some sort of offset? I did the following select query, which selects a message from a message table. select id, subject from messages where to_uid=1 and read_timestamp0 order by timestamp desc limit 3,1; The reason is I only want it to be 3

Re: delete with an offset?

2005-10-21 Thread Dobromir Velev
I don't think it is possible at least not with one query. You can limit the numbers of record to delete, but at least until 4.1 there is no offset. Probably you can do it with a subselect like this delete from where to_uid=1 and read_timestamp0 and timestamp(select timestamp from messages

Re: delete with an offset?

2005-10-21 Thread Eric Persson
Dobromir Velev wrote: delete from where to_uid=1 and read_timestamp0 and timestamp(select timestamp from messages where to_uid=1 and read_timestamp0 order by timestamp desc limit 100,1) HTH Thanks for your answer, I guess i'll have to do with two queries, but it looked like such and idea