【译文】如何使用Access SQL 检索记录(一)-周芳
Access软件网QQ交流学习群(群号码198465573),欢迎您的加入!
首页 >技术文章> 综合其它


【译文】如何使用Access SQL 检索记录(一)

发表时间:2014/2/17 9:24:13 评论(0) 浏览(6466)  评论 | 加入收藏 | 复制
   
摘 要:如何使用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群(群号:198465573)
 
 相关文章
【译文】如何在子窗体或者子报表中调用程序  【周芳  2013/12/10】
【译文】为什么使用Access作为开发工具  【周芳(译)  2013/12/17】
【译文】如何用ADO代码实现窗体记录集的绑定  【周芳  2013/12/24】
【译文】如何检索已安装打印机的列表  【周芳  2013/12/31】
【译文】如何输出报表到XML文件  【周芳  2014/1/27】
常见问答
技术分类
相关资源
文章搜索
关于作者

周芳

文章分类

文章存档

友情链接