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