> > 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 delete
> > every "O" record which has an accompanying "X" record.
>
> Doesn't really make any sense.  Isn't it saying to delete records
> where:
>
> WHERE prod_price_chg_flag = "0"
>   AND prod_price_chg_flag = "X"
>
[JS] No. prod_id is not a unique key. If this were legal, it would select
all products that have an "X" price and then delete all "O" prices from
those products.

Two or more price records having the same prod_id, that's what I meant by
"accompanying".


> What do you mean by "accompanying" record?  Accompanying in a
> _different_
> table?  Or maybe you have some other criteria for determining
> "accompanying"?





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to