Re: [SQL] Using new.id in the WHERE condition of one UPDATE inside ON INSERT rule

2010-03-01 Thread Aron
On Jueves 25 Febrero 2010 16:28:56 usted escribió: > Aron writes: > > I would like to avoid using "SELECT MAX(id) FROM my_table" (it doesn't > > seem a good method), but if I use "new.id", I get new id values, not the > > "id" i

[SQL] Using new.id in the WHERE condition of one UPDATE inside ON INSERT rule

2010-02-25 Thread Aron
I would like to avoid using "SELECT MAX(id) FROM my_table" (it doesn't seem a good method), but if I use "new.id", I get new id values, not the "id" inserted with the rule, and the condition is always false. Complete example (it works because it doesn't use new.id inside condition): DROP TABLE