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, concise, and completely
[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/got
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 wanted to do.
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
-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... :) The
WHERE in the DELETE should
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, concise, and completely illegal. I want to
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
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