← Back to team overview

maria-discuss team mailing list archive

Re: DELETE FROM RETURNING

 

Hi Justin,

On Thu, Jun 11, 2015 at 12:28 PM, Justin Swanhart <greenlion@xxxxxxxxx> wrote:
> Hi,
>
> Really, the SQL-2003 standard syntax would be nice (implementing
> non-recursive CTE is mostly trivial, btw):
>
> WITH moved_rows AS (
>     DELETE FROM products
>     WHERE
>         "date" >= '2010-10-01' AND
>         "date" < '2010-11-01'
>     RETURNING *
> )
> INSERT INTO products_log
> SELECT * FROM moved_rows;
>

I agree. It would be great if MariaDB supported CTEs. I've submitted a
feature request for that as well:

https://mariadb.atlassian.net/browse/MDEV-8308

If you have a patch, feel free to contribute it.

Thanks,

Geoff


Follow ups

References