从sdf文件中删除第一行 [英] Delete top row from sdf file

查看:143
本文介绍了从sdf文件中删除第一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的专家,

我有一个.sdf db文件.我想从表格中删除第一行.

Dear Exper,

I''ve a .sdf db file. i want to delete first row from a table.

DELETE TOP (1) FROM   myTable

无法正常工作.

is not working.

Please let me know wht is the alternative for this.

推荐答案

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

如果要从顶部删除特定记录,则需要选择适当的记录并将其删除.最安全的通用方法是:
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[^]


这篇关于从sdf文件中删除第一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆