List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 17 2003 4:22pm
Subject:Re: How to delete from only one side of a join?
View as plain text  
At 9:32 -0600 2/17/03, Mayo, Chuck wrote:
>Hi all,
>
>Just jumped on the list, hoping someone can give me a hand. The query below
>uses a join, I guess, to select records from table stat_1_1 based on
>information in table stat. I'd like to be able to turn this query into a
>delete query but only want records removed from stat_1_1. Can anyone tell me
>how? I must be missing something really obvious.

Replace SELECT DISTINCT with DELETE. :-)

You need MySQL 4.0.x for this to work.  Probably at least 4.0.2.

>
>Thanks,
>Chuck Mayo
>
>  SELECT DISTINCT
>         stat_1_1.event_id
>
>  FROM
>         stat_1_1,
>         stat
>
>  WHERE
>         stat_1_1.player_id=39
>         && stat_1_1.stat_id = stat.id
>         && stat.stat_group = "Individual"

Thread
How to delete from only one side of a join?Chuck Mayo17 Feb
Re: How to delete from only one side of a join?Paul DuBois17 Feb
Re: How to delete from only one side of a join?Paul DuBois17 Feb