访问数据库限制关键字 [英] Access Database LIMIT keyword

查看:169
本文介绍了访问数据库限制关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我的网页列表功能ASP工作与Access数据库,但我不知道替代微软SQL到极限。我曾尝试TOP但这似乎并没有工作。

I'm trying to get my page listing function working in ASP with an Access database, but I don't know the alternative to LIMIT in Microsoft SQL. I have tried TOP but this doesn't seem to be working.

下面是语句正在使用与MySQL:

Here is the statement am using with MySQL:

SELECT  * FROM customers ORDER BY customerName DESC LIMIT 0, 5

我怎样才能将其转换为与Access数据库?

How can I convert this to work with Access Database?

推荐答案

据MS-访问视图:

SELECT TOP(5) * FROM customers ORDER BY customerName; 

将获取一个错误SELECT语句包含保留字

will fetch an error "The SELECT statement includes a reserved word",

正确的语法是:

SELECT TOP 5 * FROM customers ORDER BY customerName; 

(注意括号)。

这篇关于访问数据库限制关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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