From (SQL)
SQL clause for selecting data source
title: "From (SQL)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["sql-keywords", "articles-with-example-sql-code"] description: "SQL clause for selecting data source" topic_path: "technology/databases" source: "https://en.wikipedia.org/wiki/From_(SQL)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary SQL clause for selecting data source ::
The SQL From clause is the source of a rowset to be operated upon in a Data Manipulation Language (DML) statement. From clauses are very common, and will provide the rowset to be exposed through a Select statement, the source of values in an Update statement, and the target rows to be deleted in a Delete statement.
FROM is an SQL reserved word in the SQL 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 Schema, 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.
::code[lang=sql] 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 - known as DUAL table in Oracle database. ::code[lang=sql] SELECT 3.14 AS Pi ::
Other systems will require a From statement with a keyword, even to select system data. ::code[lang=sql] select to_char(sysdate, 'Dy DD-Mon-YYYY HH24:MI:SS') as "Current Time" from dual; ::
References
References
- "From clause in Transact SQL".
- "Reserved Words in SQL".
- "System Information Schema Views (Transact-SQL)".
- "Selecting from the DUAL Table".
- "Oracle Dates and Times".
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::