FROM Clause (SQL Server Compact Edition)

Specifies the tables to retrieve rows from. In Microsoft SQL Server 2005 Compact Edition, the FROM clause is optional.

Syntax

[ FROM { < table_source > } [ ,...n ]  
< table_source > ::= 
      table_name [ [ AS ] table_alias ] 
   | < joined_table > 
< joined_table > ::= 
   < table_source > < join_type > < table_source > ON < search_condition > 
| <table_source> CROSS JOIN <table_source>
   | ( < joined_table > )
< join_type > ::= 
   [ INNER | { { LEFT | RIGHT } [ OUTER ] } ] JOIN ]

Arguments

  • < table_source >
    Specifies the tables and joined tables for the SELECT statement.
  • table_name [ [ AS ] table_alias]
    Specifies the name of a table and an optional alias.
  • < joined_table >
    A result set that is the join of two or more tables.

    For multiple joins, you can use parentheses to specify the order of the joins.

  • < join_type >
    Specifies the type of join operation.
  • CROSS JOIN
    Specifies the cross-product of two tables.
  • INNER
    Specifies that all matching pairs of rows are returned. Discards unmatched rows from both tables. This is the default if no join type is specified.
  • LEFT [ OUTER ]
    Specifies that all rows from the left table that are not meeting the specified condition are included in the result set in addition to all rows returned by the inner join. Output columns from the left table are set to NULL.
  • RIGHT [ OUTER ]
    Specifies that all rows from the right table that are not meeting the specified condition are included in the result set in addition to all rows returned by the inner join. Output columns from the right table are set to NULL.
  • JOIN
    Indicates that the specified tables should be joined.
  • ON < search_condition >
    Specifies the condition that the join is based on. The condition can specify any valid predicate, although columns and comparison operators are often used.