TABLE Keyword
TABLE Keyword is a SQL statement in the Set Operations category. SQL standard shorthand for SELECT * FROM table_name. Useful as a building block in set operations. The syntax is TABLE table_name;. It returns all rows from table. A typical example: TABLE employees; -- Equivalent to: SELECT * FROM employees TABLE employees UNION TABLE managers; -- Equivalent to: SELECT * FROM employees UNION SELECT * FROM managers A close relative is UNION, which combines results from two queries, removing duplicate rows. Each SELECT must have the same number of columns. A close relative is UNION ALL, which like UNION but does NOT remove duplicate rows. Faster because no dedup is needed. A close relative is INTERSECT, which returns rows that appear in BOTH query results. Supported in PostgreSQL, SQL Server, Oracle. More about this category: Set-based operations — UNION, UNION ALL, INTERSECT, EXCEPT. Related Set Operations entries: UNION, UNION ALL, INTERSECT, EXCEPT / MINUS, INTERSECT ALL / EXCEPT ALL, Ordering Set Operations, Set Operation Precedence, Set Operation with ORDER BY.