Re: [SQL] keeping last 30 entries of a log table

2006-06-19 Thread Daniel CAUNE
> >> insert into log (account_id, message) values (1, 'this is a test); > >> delete from log where account_id = 1 and id not in ( select id from log > >>where account_id = 1 order by timestamp desc limit 30); > >> > >> I'm wondering if there is a more performance oriented method of doing > the

Re: [SQL] keeping last 30 entries of a log table

2006-06-19 Thread Jeff Frost
On Sat, 17 Jun 2006, Daniel CAUNE wrote: insert into log (account_id, message) values (1, 'this is a test); delete from log where account_id = 1 and id not in ( select id from log where account_id = 1 order by timestamp desc limit 30); I'm wondering if there is a more performance oriented me

Re: [SQL] concurrency problem

2006-06-19 Thread Andrew Sullivan
On Sat, Jun 17, 2006 at 09:23:17AM +0530, sathish kumar shanmugavelu wrote: > I fetch the consultatioin_no and add one to it, i should know this > consultation_no to save the other 10 tables. because i use this number as Don't do that. Fetch the number from a sequence first: select nextval().