RE: Forbidden subquery

2007-12-20 Thread Jerry Schwartz
> -Original Message- > From: Jay Pipes [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 20, 2007 11:25 AM > To: Jerry Schwartz > Cc: mysql@lists.mysql.com > Subject: Re: Forbidden subquery > > No problem. I hope by now you figured out I made a typo... :) T

Re: Forbidden subquery

2007-12-20 Thread Jay Pipes
No problem. I hope by now you figured out I made a typo... :) The WHERE in the DELETE should be prod_price_chg_flag='O', not ="X" :) -jay Jerry Schwartz wrote: Hi Jerry! The very last sentence on: http://dev.mysql.com/doc/refman/5.0/en/delete.html is "Currently, you cannot delete from a ta

RE: Forbidden subquery

2007-12-20 Thread Jerry Schwartz
> > Hi Jerry! > > The very last sentence on: > http://dev.mysql.com/doc/refman/5.0/en/delete.html > > is "Currently, you cannot delete from a table and select from the same > table in a subquery." > [JS] Yes, I knew that. I just thought that illegal query was the best way of expressing what I wante

RE: Forbidden subquery

2007-12-20 Thread Jerry Schwartz
[mailto:[EMAIL PROTECTED] Sent: Wednesday, December 19, 2007 7:07 PM To: Jerry Schwartz Cc: mysql@lists.mysql.com Subject: Re: Forbidden subquery Hy , i´ve done some search regarding your issue and i think you may find this interesting : <http://forums.devshed.com/mysql-help-4/

RE: Forbidden subquery

2007-12-20 Thread Jerry Schwartz
> > What I want to accomplish is expressed best as > > > > DELETE FROM prod_price > > WHERE prod_price.prod_price_chg_flag = "O" > > AND prod_price.prod_id IN > > > >(SELECT prod_price.prod_id FROM prod_price > >WHERE prod_price.prod_price_chg_flag = "X") > > ; > > > > This is clear, concis

Re: Forbidden subquery

2007-12-19 Thread Jay Pipes
Hi Jerry! The very last sentence on: http://dev.mysql.com/doc/refman/5.0/en/delete.html is "Currently, you cannot delete from a table and select from the same table in a subquery." But, to bypass that, you can create a temp table and join to that: CREATE TEMPORARY TABLE to_delete SELECT prod

Re: Forbidden subquery

2007-12-19 Thread Rodrigo Marins
Hy , i´ve done some search regarding your issue and i think you may find this interesting : http://forums.devshed.com/mysql-help-4/got-error-134-from-storage-engine-error-number-1030t-446448.html http://dev.mysql.com/doc/refman/5.0/en/corrupted-myisam-tables.html 2007/12/19, Jerry Schw