Delete the first 100 data entries and sort them by the primary key ID. How to write SQL statements? Delete & nbsp; from & nbsp; visitrecord & nbsp; where & nbsp; id & nbsp; in & nbsp; (select & nbsp; top & nbsp; 100 & nbsp; from & nbsp; visitrecord & nbsp; order & nbsp; by & nbsp; id & nbs delete the first 100 pieces of data, sorted by the primary key ID.
How to write SQL statements?
delete from visitrecord where id in (select top 100 from visitrecord order by id asc)
Is there any error in this writing?
------ Solution --------------------
Delete from visitrecord where id in (select id from visitrecord order by id asc limit 100)
------ Solution --------------------
delete from visitrecord limit 100
------ Solution --------------------
Delete from visitrecord where id in (select id from visitrecord order by id asc limit 100)
------ Solution --------------------
This version of MySQL doesn't yet support 'limit & IN/ALL/ANY/SOME subquery
------ Solution --------------------
Delete from visitrecord where id in (select top 100 from visitrecord order by id asc)
Your writing method is sqlserver
Mysq is written as follows:
Delete from visitrecord where id in (select id from visitrecord order by id asc limit 100 );
------ Solution --------------------
They're all great gods. I'm just passing ~~~