A query is an SQL SELECT statement that selects data from one or more tables or views.
Syntax for the simplest SQL statement:
SELECT select_list FROM table_list;
Where, select_list specifies the columns, functions,
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 statement. table_list can also be used as 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 the DUAL table which is a dummy table. In this case, select_list does not specify a specific column but a constant or variable. Take the following SQL statement as an example:
$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 (0.01 sec)
For more information about how to use queries, see OceanBase SQL Reference (Oracle Mode).