且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从sdf文件中删除第一行

更新时间:2023-12-04 11:40:04

好吧,可能是-但由于您未指定订单,因此无法说实话,因为删除的行将取决于记录的内部顺序,而不是您已应用(或认为已应用)的任何顺序.

如果要从顶部删除特定记录,则需要选择适当的记录并将其删除.最安全的通用方法是:
Well, it probably is - but since you don''t specify an order, you can''t really tell, as the rows that are deleted will depend on the internal order of records, rather than any order you have applied (or think you have applied).

If you want to delete specific records from the top, then you need to select the appropriate records and delete those. The safest general purpose way to do it is:
DELETE FROM myTable WHERE id IN (SELECT TOP 1 id FROM myTable ORDER BY myOrderColumn)


如果您的标签正确并且使用的是MySQL,则可以使用LIMIT 子句检索顶部记录并将其删除.

例如:
If your tags are correct and you''re using MySQL, you can use LIMIT clause to retrieve the top records and to delete them.

For example:
DELETE FROM TheTable
WHERE ...
ORDER BY ...
LIMIT 1;



有关更多信息:删除语法 [



For more information: DELETE Syntax[^]