【译文】如何使用Access SQL 检索记录(一)
时 间:2014-02-17 09:24:13
作 者:周芳 ID:24526 城市:上海
摘 要:如何使用Access SQL 检索记录
正 文:
来自:微软 翻译:周芳
【译文】 如何使用Access SQL 检索记录
最基本、最常用的SQL语句是Select语句。Select语句是所有SQL语句的核心组成部分,而它们通常称为Select查询。使用Select语句从数据库表中检索数据,并且返回的结果通常是由任意数量的字段(或列)组成的一组记录(或行)。你必须使用FROM子句指定表或表来选择。Select语句的基本结构是:
VBA:
Select field list
FROM table list
要查询表中的所有字段,用星号(*)。例如,以下语句是从客户表中查询所有的字段和记录。
VBA:
Select *
FROM tblCustomers
限制查询检索的字段,只需使用字段名。例如:
VBA:
Select [Last Name], Phone
FROM tblCustomers
在结果集字段指定一个不同的名称,使用关键字建立该字段的别名。
VBA:
Select CustomerID AS [Customer Number]
FROM tblCustomers
【原文】 How to: Retrieve Records Using Access SQL
The most basic and most often used SQL statement is the Select statement. Select statements are the workhorses of all SQL statements, and they are commonly referred to as select queries. You use the Select statement to retrieve data from the database tables, and the results are usually returned in a set of records (or rows) made up of any number of fields (or columns). You must use the FROM clause to designate which table or tables to select from. The basic structure of a Select statement is:
VBA:
Select field list
FROM table list
To select all fields from a table, use an asterisk (*). For example, the following statement selects all the fields and all the records from the Customers table.
VBA:
Select *
FROM tblCustomers
To limit the fields retrieved by the query, simply use the field names instead. For example.
VBA:
Select [Last Name], Phone
FROM tblCustomers
To designate a different name for a field in the result set, use the AS keyword to establish an alias for that field.
VBA:
Select CustomerID AS [Customer Number]
FROM tblCustomers
Access软件网QQ交流群 (群号:483923997) Access源码网店
常见问答:
技术分类:
源码示例
- 【源码QQ群号19834647...(12.17)
- 【Access窗体导出PDF】...(04.08)
- 【Access窗体导出PDF】...(04.07)
- Access两种方式实现即时更...(03.01)
- Access隐藏与显示lacc...(01.12)
- 【Access高效办公】将每个...(12.23)
- Access21点游戏源代码(12.13)
- 【Access窗体导出Exce...(11.15)
- 【Access开发】Acces...(11.14)
- 通过Access宏录入数据到选...(11.10)
学习心得
最新文章
- Access学习笔记--用Acce...(04.19)
- 【Access重复项查询示例】将A...(04.17)
- Access快速开发平台企业版--...(04.16)
- 【Access模块示例】通过模块代...(04.15)
- Access查询里面分组合计功能添...(04.13)
- 【Access删除查询】删除数字最...(04.12)
- 显示文件夹中所有文件的修改时间(04.11)
- 铁路工程管理系统;铁路工程管理小程...(04.10)
- 【Access查询示例】怎么将两个...(04.09)
- 【Access窗体导出PDF】Ac...(04.08)