access通配符模糊查找_在Access 2010中使用通配符条目

access通配符模糊查找

access通配符模糊查找

Carrying out complex operations & applying conditions on tables in Access are not that much easy as in Excel. Some users are still confusing it with Excel which is synonymous to belittling Access capabilities.

在Access中对表执行复杂的操作和应用条件并不像在Excel中那样容易。 某些用户仍将其与Excel混淆,后者等同于贬低Access功能。

Editor Note: This Guest Article was written by Office 2010 Club, a forum managed by Office 2010 experts where anyone can ask questions and participate in discussions.

编者注:本来宾文章由 Office 2010 Club 撰写, Office 2010 Club 是一个由Office 2010专家管理的论坛,任何人都可以提问和参与讨论。

Access however, provides essentials of Relational Database Management System. RDBMS are not abound and only advance users can manipulate the database structure for applying different conditions, meanwhile the rapid influx of RDBMS-based dynamic web apps and other utilities also poses a dire need of comprehending the basics of relational databases.

但是,访问提供了关系数据库管理系统的要点。 RDBMS并不比比皆是,只有高级用户才能操纵数据库结构以适应不同的条件,与此同时,基于RDBMS的动态Web应用程序和其他实用程序的Swift涌入也带来了对关系数据库基础知识的迫切需求。

As of now, SQL stands first in handling database structure for pulling out specific data from tables, but a database novice needs to learn the language syntax & its proper usage. On the other hand, Access weighing GUI interface, provides Wild Card entries as replacement of SQL WHERE command for easy extraction of specific data from database tables & queries.

到目前为止,SQL在处理从表中提取特定数据的数据库结构方面处于领先地位,但是数据库新手需要学习语言语法及其正确用法。 另一方面,Access weighting GUI界面提供了通配符条目,以替代SQL WHERE命令,从而可以轻松地从数据库表和查询​​中提取特定数据。

This post will demonstrate the simple usage of Wild Card entries. We will start off with applying Wild Card conditions on an existing database. For illustration, we have created a small store management database containing multiple tables; Customer, New products, Sales, Phone Numbers, and Staff. For pulling out data through Wildcard Entries, switch to Create tab and click Query Design.

这篇文章将演示通配符条目的简单用法。 我们将从在现有数据库上应用通配符条件开始。 为了说明起见,我们创建了一个包含多个表的小型商店管理数据库。 客户,新产品,销售,电话号码和员工。 要通过通配符条目提取数据,请切换到“创建”选项卡,然后单击“查询设计”。

create

It will bring up Show Table dialog, allowing you to add tables. Now start adding desired tables into Query Design window.

它将弹出“显示表”对话框,允许您添加表。 现在开始将所需的表添加到“查询设计”窗口中。

add table

Once added, start dragging required table into Query Design fields.

添加后,开始将所需的表拖到“查询设计”字段中。

fields added

Now we are interested in pulling out all relevant data residing in database tables against Product name “Pepsi”. For this, we will simply write Wildcard Entry, i.e, Like/Not Like condition under Product Name field like this;

现在,我们有兴趣针对产品名称“ Pepsi”提取数据库表中的所有相关数据。 为此,我们将简单地编写通配符条目,即在“产品名称”字段下的“喜欢/不喜欢”条件,如下所示;

Like “Pepsi”

就像“百事可乐”

On executing the query it will show all the relevant info included in Query Design fields ranging from Customer ID, Customer Name to Employee Name, etc.

执行查询时,它将显示查询设计字段中包括的所有相关信息,范围从客户ID,客户名称到员工名称等。

run
run1

Lets take a look at another example. Suppose we need to find out all the Customers having their names start with ‘G’. For applying this condition, we will write Like condition under Customer Name as;

让我们看另一个例子。 假设我们需要找出所有名称以“ G”开头的客户。 为了应用此条件,我们将在“客户名称”下写为“条件”为;

Like “G*”

就像“ G *”

This condition will make Access pull out all the field values which matches with the condition specified (alphabet, numeric value, etc) before asterisk sign.

此条件将使Access拔出与星号前指定的条件(字母,数字值等)匹配的所有字段值。

astterisk

On running query, it will show all the relevant data of customers having their name starts with ‘G’.

在运行查询时,它将显示名称以“ G”开头的客户的所有相关数据。

asterisk1

For excluding a specific record/data value from the Query. ‘Not Like’ condition comes in handy. It will exclude the specified data value from the records and shows only remaining records.

用于从查询中排除特定的记录/数据值。 “不喜欢”条件派上用场。 它将从记录中排除指定的数据值,并且仅显示剩余的记录。

not like

It will show results excluding all the records where Employee Name starts with ‘L’.

它将显示结果,但不包括“雇员姓名”以“ L”开头的所有记录。

not like1

We have touched only few examples of Wild Card entries to extract specific data out of records. However, there are innumerable ways to extract specific records. Try out these examples on your database to explore some other dimensions of Wildcard Entries.

我们仅接触了通配符条目的几个示例,以从记录中提取特定数据。 但是,有无数种提取特定记录的方法。 在您的数据库上尝试这些示例,以探索通配符条目的其他方面。

Like “E#” This will return specific data from selected table having only two characters. first one is E and # represents that character is a number.

像“ E#”一样,它将从只有两个字符的所选表中返回特定数据。 第一个是E,而#表示该字符是一个数字。

Like “G?” it will return two characters if found in specific table, starting with character ‘G’.

像“ G?” 如果在特定表中找到,它将返回两个字符,以字符“ G”开头。

Like “*16” This will return data ending on 16 in the specific table.

像“ * 16”一样,它将返回特定表中以16结尾的数据。

You can also try out all aforementioned ways with Not Like condition as well. This functionality concludes infinite powerful ways possible to extract the desired data from database. We have applied these conditions on small scale database, but its real usage can be observed when you are dealing with enormous database, having hundreds of related tables.

您也可以使用“ 不喜欢”条件尝试所有上述方式。 此功能总结了从数据库中提取所需数据的无限强大方法。 我们已经将这些条件应用于小型数据库,但是当您处理具有数百个相关表的巨大数据库时,可以观察到其实际用法。

Comparing the procedure of extracting data from tables with CLI-based SQL concludes that, it is far easier in Access. The reason being, CLI(Command Line Interface) brings monotony that repels novices to get their hands on to it. On the other hand, Access 2010’s simple GUI layout encourages user to begin creating database without having to indulge in labyrinth of command controls, & hard-to-grab syntax.

将使用基于CLISQL从表中提取数据的过程进行比较,可以得出结论,在Access中它要容易得多。 原因是CLI(命令行界面)带来了单调,从而排斥了新手。 另一方面, Access 2010的简单GUI布局鼓励用户开始创建数据库,而不必沉迷于命令控件和难以掌握的语法中。

翻译自: https://www.howtogeek.com/howto/19907/using-wild-card-entries-in-access-2010/

access通配符模糊查找

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值