设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1519|回复: 7
打印 上一主题 下一主题

[其它] 这样的SQL的from子句错在拿里。

[复制链接]
跳转到指定楼层
1#
发表于 2003-12-21 05:52:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
FROM (chlzbk LEFT JOIN cpfk ON chlzbk.序号 = cpfk.序号) LEFT JOIN zjfk ON chlzbk.序号 = zjfk.序号
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2003-12-21 05:58:00 | 只看该作者
好象无法解释:

As when using Access QBE, you can create SELECT statements that join more
than two tables. Asimplified syntax for specifying joins of multiple tables in the
FROM clause is
FROM (… (table1 JOIN table2 ON conditionA) JOIN table3 ON conditionB)
JOIN …)
You may find this nested-style syntax a little confusing. It implies a set order in
which the joins are performed—for example, “first join table1 to table2 and then
join that result to table3 and then….” But the order of joins doesn’t really matter
in Access. No matter how you specify the order in the FROM clause, the Jet query
processor decides on the optimum ordering of joins for the sake of efficiency. This
is the way it should be in the relational model.
3#
发表于 2003-12-21 06:03:00 | 只看该作者
书上是这么说的:
If you need to create a query that does not follow these rules, you can usually
break it up into multiple stacked queries that Jet can handle. For example, say you
wished to list all customers and the items they ordered but include customers
4#
发表于 2003-12-21 06:06:00 | 只看该作者
比如这个就不行:
SELECT LastName, OrderDate,
Quantity, MenuDescription
FROM ((tblOrder INNER JOIN tblOrderDetails
ON tblOrder.OrderId = tblOrderDetails.OrderId)
INNER JOIN tblMenu ON tblOrderDetails.MenuId = tblMenu.MenuId)
RIGHT JOIN tblCustomer ON tblOrder.CustomerId =
tblCustomer.CustomerId
ORDER BY LastName, OrderDate DESC;
5#
 楼主| 发表于 2003-12-21 06:10:00 | 只看该作者
怎样分成多个查询。
6#
发表于 2009-12-13 22:40:20 | 只看该作者
高深,没懂!
7#
发表于 2009-12-13 22:43:25 | 只看该作者
8#
发表于 2009-12-14 10:57:20 | 只看该作者
好像chlzbk不能在left join中有多次重名吧,你试一下:
select *, chlzbk as chlzbk_1
FROM (chlzbk LEFT JOIN cpfk ON chlzbk.序号 = cpfk.序号) LEFT JOIN zjfk ON chlzbk_1.序号 = zjfk.序号
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-11-18 18:44 , Processed in 0.135324 second(s), 31 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表