Sql.Net Class Library Documentation

FromTerm Class

Represents one term in the the FROM clause of a select statement.

For a list of all members of this type, see FromTerm Members.


public class FromTerm

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


A from term can be either a table, table reference or a subquery. subqueries. Table is a name of a table or view with an optional alias. Use TableRef to specify a reference to another term. You will usually use TableRef to specify one of the previously defined tables in a join. SubQuery creates a term with a subquery and mandatory alias. Please note that not all databases support sub-queires.


The follwoing example selects some columns from two tables joined by a left outer join.

FromTerm tCustomers = FromTerm.Table("customers");
FromTerm tProducts = FromTerm.Table("products", "p");
FromTerm tOrders = FromTerm.Table("orders", "o");

SelectQuery query = new SelectQuery();
query.Columns.Add(new SelectColumn("name", tCustomers));
query.Columns.Add(new SelectColumn("name", tProducts));
query.FromClause.BaseTable = tCustomers;
query.FromClause.Join(JoinType.Inner, query.FromClause.BaseTable, tOrders, "customerId", "customerId");
query.FromClause.Join(JoinType.Inner, tOrders, tProducts, "productId", "productId");


Namespace: Reeb.SqlOM

Assembly: Reeb.SqlOM (in Reeb.SqlOM.dll)

See Also

FromTerm Members | Reeb.SqlOM Namespace