List:General Discussion« Previous MessageNext Message »
From:Diana Soares Date:December 3 2003 4:42pm
Subject:Re: Fw: mysql request problem.
View as plain text  
On Wed, 2003-12-03 at 09:22, lamjoun wrote:
> I have a problem with this request.
> 
> insert into table month_var (year,month,var_cd,val)  select
> '2003','10',var_cd,0 from var and
> var_cd not in (select var_cd from pers_var where year='2003' and
> month='10');
> 
> after execution I have this error 
> 
> [Mysql][ODBC 3.51 Driver][mysqld-4.1.0-alpha-max-nt] you can't specify
> target table 'month_var' for update in from clause.

Is your query correctly pasted ? 

insert into table month_var (year,month,var_cd,val)  select
'2003','10',var_cd,0 from var and var_cd not in (select var_cd from
pers_var where year='2003' and month='10');

Look at:
from var and var_cd not in

supposed to be:

from var where var_cd not in

-- 
Diana Soares

Thread
Fw: mysql request problem.lamjoun3 Dec
  • Re: Fw: mysql request problem.Diana Soares3 Dec
  • Re: Fw: mysql request problem.lamjoun3 Dec