List:General Discussion« Previous MessageNext Message »
From:lamjoun Date:December 3 2003 6:08pm
Subject:Re: Fw: mysql request problem.
View as plain text  
Hi
I have an error in my request the right request is
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 month_var where year='2003' and
month='10');
thanks

----- Original Message -----
From: "Diana Soares" <dsoares@stripped>
To: "lamjoun" <lamjoun@stripped>
Cc: <mysql@stripped>
Sent: Wednesday, December 03, 2003 4:42 PM
Subject: Re: Fw: mysql request problem.


> 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