[MDEV-22405] Unable to delete data using CTE Created: 2020-04-29  Updated: 2020-04-29  Resolved: 2020-04-29

Status: Closed
Project: MariaDB Server
Component/s: Data Manipulation - Delete
Affects Version/s: 10.4.4
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Dennis Kwone Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-18511 CTE support for UPDATE and DELETE sta... Stalled

 Description   

create table CONTACT_EMAIL (
ID INT auto_increment primary key,
CONTACT_NAME VARCHAR(50) default null,
CONTACT_EMAIL VARCHAR(50) not null
);

insert into contact_email(Contact_email,contact_name)
VALUES
('info@kimann.com','SK NG'),
('info@kimann.com','SL LIM'),
('strip2@kimann.com','SK NG'),
('strip@kimann.com','SL LIM');

;with recursive dupemail as (select id ,contact_email,row_number() OVER(partition by contact_email order by id,contact_email) as ROWID from contact_email)
select * from dupemail;

/UNABLE to delete the records using CTE/
;with recursive dupemail as (select id ,contact_email,row_number() OVER(partition by contact_email order by id,contact_email) as ROWID from contact_email)
delete from contact_email ce where id in (select id from dupemail where rowid>1);



 Comments   
Comment by Alice Sherepa [ 2020-04-29 ]

Sorry, this is not supported yet. If you'd like to follow the progress, please watch MDEV-18511

Generated at Thu Feb 08 09:14:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.