在本章中,我们将讨论sql视图。每当您在查询设计中创建查询时,Access会自动为您创建SQL查询。这实际上从表中检索数据。要在查询设计中创建查询时查看在SQL中如何创建查询,请打开您的数据库。
从“创建”选项卡中选择“查询设计”,然后添加tblEmployees表。


选择要查看为查询结果的字段,然后运行查询。

您现在可以查看所有员工信息作为查询结果。您在查询网格中选择了某些字段;同时,MS Access还创建了一个SQL查询,其结果从您的查询网格获得。
要查看SQL,请转到“主页”选项卡。从视图菜单中选择SQL视图,您将看到查询的SQL。

例子
下面是另一个例子,其中,我们将看到正在进行的项目。


现在让我们来运行查询。

要查看SQL,请从“视图”菜单中选择SQL视图。

您可以看到Access自动生成的SQL查询。这有助于从两个表中检索数据。