A query is a SELECT statement that retrieves data from one or more tables or views.
Syntax for the simplest SQL query statement:
SELECT select_list FROM table_list;
In the syntax, select_list specifies the columns, functions, constants, or variables from table_list.
constants, or variables from the table_list that follows.
table_list specifies the tables or views that contain the data to be selected.
The preceding example is a simple SQL query statement. table_list can also be a subquery. You can add a WHERE clause to filter results returned by the query.
Note that in an Oracle tenant, table_list can be replaced with a DUAL table, which is a dummy table. In this case, select_list does not specify a specific column. Instead, it is a constant or variable. See the following example SQL statement:
$obclient -h10.0.0.0 -utpcc@t_oracle0_91#obdoc -P2883 -p**1*** tpcc
obclient> select 'Medium', 6*6 from dual;
+-------+-----+
| 'Medium' | 6*6 |
+-------+-----+
| Medium | 36 |
+-------+-----+
1 row in set