← Back to team overview

maria-developers team mailing list archive

Re: Oracle compatibility : Update with same source and target

 

Hi Alexander,

Here is an example : 

use test;
set sql_mode=oracle;
DROP TABLE if exists t1;
CREATE TABLE t1 (c1 INT, c2 INT);
update t1
   set c1=1
 where c2 = (SELECT b.c2 FROM t1 b WHERE b.c1=0);

--> ERROR 1093 (HY000) at line 5: Table 't1' is specified twice, both as a target for 'UPDATE' and as a separate source for data


Regards,
Jérôme.

> -----Message d'origine-----
> De : Alexander Barkov [mailto:bar@xxxxxxxxxxx]
> Envoyé : vendredi 19 mai 2017 16:18
> À : jerome brauge
> Cc : 'MariaDB Developers (maria-developers@xxxxxxxxxxxxxxxxxxx)'
> Objet : Re: Oracle compatibility : Update with same source and target
> 
> Hi Jerome,
> 
> 
> On 05/19/2017 05:36 PM, jerome brauge wrote:
> > Hello Alexander,
> > In the same spirit of MDEV-12137, can you create a task for update with
> same source and target ?
> 
> Can you please send some SQL script examples that work in Oracle, but do
> not work in MariaDB?
> 
> Thanks!
> 
> 
> > Regard,
> > Jérôme.
> >


Follow ups

References