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, or 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 a MySQL tenant, the FROM table_list clause is optional. Without this clause, 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 -u******@obmysql#obdemo -P2883 -p**1*** -A tpccdb
obclient> select 'Medium', 6*6 ;
+-----+-----+
| Medium | 6*6 |
+-----+-----+
| Medium | 36 |
+-----+-----+
1 row in set (0.00 sec)
For more information about how to use queries, see OceanBase SQL Reference (MySQL Mode).