To query data that satisfies specified conditions, add a WHERE clause to the SELECT statement. SQL statement:
SELECT select_list FROM table_list
WHERE query_condition
To search for orders of Zone 5 in Warehouse 2, execute the following SQL statement:
obclient> SELECT * FROM ordr WHERE o_w_id=2 and o_d_id=5 ;
+--------+--------+------+--------+--------------+----------+-------------+------------+
| o_w_id | o_d_id | o_id | o_c_id | o_carrier_id | o_ol_cnt | o_all_local | o_entry_d |
+--------+--------+------+--------+--------------+----------+-------------+------------+
| 2 | 5 | 2100 | 2100 | 5 | 12 | 1 | 2020-02-15 |
| 2 | 5 | 2101 | 4 | NULL | 11 | 1 | 2020-02-15 |
| 2 | 5 | 2102 | 440 | NULL | 7 | 1 | 2020-02-15 |
+--------+--------+------+--------+--------------+----------+-------------+------------+
3 rows in set (0.01 sec)