2.3. The Ubiquitous SELECT Statement

In the examples of tools for running SQL, you've seen the following simple SELECT statement:

select * from dept;

In its most basic form, the SELECT statement has a list of columns to select from a table, using the SELECT ... FROM syntax. The * means "all columns." To successfully retrieve rows from a table, the user running the query must either own the table or have the permissions granted to the user by the owner or a DBA. The most basic SELECT syntax can be described as follows:

SELECT {* | [DISTINCT] column| expression [alias], ...}
  FROM tablename;

This type of statement representation is typical of what you'll see in Oracle documentation, and it can be very complex. Here is a summary of what the elements ...

Get Oracle Database Foundations now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.