SQL Compact 选择前 1 [英] SQL Compact select top 1

查看:26
本文介绍了SQL Compact 选择前 1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将应用程序从 SQL 2005 移植到 SQL Server Compact Edition 时,我发现我需要移植这个命令:

While porting an application from SQL 2005 to SQL Server Compact Edition, I found that I need to port this command:

SELECT TOP 1 Id FROM tblJob WHERE Holder_Id IS NULL

但 SQL Server Compact Edition 不支持 TOP 关键字.如何移植此命令?

But SQL Server Compact Edition doesn't support the TOP keyword. How can I port this command?

推荐答案

SELECT TOP(1) Id 
FROM tblJob 
WHERE Holder_Id IS NULL

据我所知需要括号.

参考:http://technet.microsoft.com/en-us/图书馆/bb686896.aspx

补充:同样,仅适用于 3.5 及以上版本

addition: likewise, only for version 3.5 onwards

这篇关于SQL Compact 选择前 1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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