I have a table testing with two columns
id: auto_incrementname: varchar(20)
I fired a query select * from testing limit 1, 2 which gave me 2nd and 3rd record. Now, I want to delete these records from MySQL table (InnoDB engine). How can I achieve this?
This table I have created is just for testing purposes. My actual table contains billions of records. One way I thought as:
delete from testing where id in (select group_concat(id) from testing limit 1, 2);
I think this would be quite slow in case of my actual table.
Can anyone provide any better solution?
order by id,order by name,order by name desc, etc...)LIMITwithoutORDER BYwill essentially give some random results. – ypercubeᵀᴹ Apr 20 '16 at 18:42order byis applied on first column, which is an auto_increment id here. Am I clear now? – Kamal Nayan Apr 21 '16 at 07:17