Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » SQL Anywhere 服务器 - SQL 的用法 » 查询和修改数据 » 连接:从多个表检索数据 » 连接的工作原理

 

FROM 子句

使用 FROM 子句指定要连接哪些基表、临时表、视图或派生表。FROM 子句可用于 SELECT 或 UPDATE 语句中。FROM 子句的简写语法如下:

FROM table-expression, ...

其中:

table-expression :
table-name 
| view-name 
| derived-table-name
| lateral-derived-table-name  
| join-expression 
| ( table-expression, ... )
| openstring-expression
| apply-expression
table-name or view-name:
[owner.] table-or-view-name [ [ AS ] correlation-name ]
derived-table-name :
( select-statement ) [ AS ] correlation-name [ ( column-name, ... ) ]
join-expression :
table-expression join-operator table-expression [ ON join-condition ]
join-operator:
[ KEY | NATURAL ] [ join-type ] JOIN 
| CROSS JOIN
join-type:
 INNER 
| FULL [ OUTER ] 
| LEFT [ OUTER ] 
| RIGHT [ OUTER ]
apply-expression :
table-expression { CROSS | OUTER } APPLY table-expression
join-condition : 

请参见搜索条件

注意

您不能将 ON 子句与 CROSS JOIN 一起使用。

有关语法的详细信息,请参见FROM 子句