The
SQLSQL is a programming language designed for managing data in relational database management systems ....
From clause is the source of a rowset to be operated upon in a
Data Manipulation Language (DML)A data manipulation language is a family of syntax elements similar to a computer programming language used for inserting, deleting and updating data in a database...
statement. From clauses are very common, and will provide the rowset to be exposed through a
SelectThe SQL SELECT statement returns a result set of records from one or more tables.A SELECT statement retrieves zero or more rows from one or more database tables or database views. In most applications, SELECT is the most commonly used Data Manipulation Language command...
statement, the source of values in an
UpdateAn SQL UPDATE statement changes the data of one or more records in a table. Either all the rows can be updated, or a subset may be chosen using a condition.The UPDATE statement has the following form:...
statement, and the target rows to be deleted in a
DeleteIn the database structured query language , the DELETE statement removes one or more records from a table. A subset may be defined for deletion using a condition, otherwise all records are removed.-Usage:The DELETE statement follows the syntax:...
statement.
FROM is an
SQLSQL is a programming language designed for managing data in relational database management systems ....
reserved word in the
SQLSQL:2003 is the fifth revision of the SQL database query language. The latest revision of the standard is SQL:2008.-Summary:The SQL:2003 standard makes minor modifications to all parts of SQL:1999 , and officially introduces a few new features such as:* XML-related features * Window functions* the...
standard
The
FROM clause is used in conjunction with SQL statements, and takes the following general form:
SQL-DML-Statement
FROM
table_name
WHERE
predicate
The From clause can generally be anything that returns a rowset, a table, view, function, or system-provided information like the
Information SchemaIn relational databases, the information schema is an ANSI standard set of read-only views which provide information about all of the tables, views, columns, and procedures in a database...
, which is typically running proprietary commands and returning the information in a table form.
Examples
The following query returns only those rows from table
mytable where the value in column
mycol is greater than 100.
SELECT *
FROM mytable
WHERE mycol > 100
Requirement
The From clause is technically required in relational algebra and in most scenarios to be useful. However many relational dbms implementations may not require it for selecting a single value, or single row.
SELECT 3.14 AS Pi
Other systems will require a From statement with a keyword, even to select system data.
select to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI:SS') as "Current Time"
from dual;