Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想删除所有行,除了前 5 行。
/*example of the $count is equal to 5 */ $count=$xml->table->records->attributes();
这是我的桌子:
xml_id 1 2 3 4 5 6 7 8 9 10
结果会是这样
xml_id 1 2 3 4 5
以上5个将被删除。
试试这个查询:
DELETE FROM Table1 WHERE xml_id NOT IN (SELECT xml_id FROM Table1 LIMIT 5)