鉴于下表
mysql> describe customers;
+-------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+----------------+
| customer_id | int(11) | NO | PRI | NULL | auto_increment |
| login | varchar(16) | NO | | NULL | |
| password | varchar(40) | NO | | NULL | |
| name | varchar(32) | NO | UNI | NULL | |
| address | varchar(64) | NO | | NULL | |
| contact | varchar(32) | NO | | NULL | |
+-------------+-------------+------+-----+---------+----------------+
6 rows in set (0.02 sec)
mysql> describe orders;
+-----------------+-------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+-------------------+----------------+
| customer_id | int(11) | NO | MUL | NULL | |
| order_id | int(11) | NO | PRI | NULL | auto_increment |
| order_timeStamp | timestamp | NO | | CURRENT_TIMESTAMP | |
| item | varchar(16) | NO | | NULL | |
| price | double | NO | | NULL | |
+-----------------+-------------+------+-----+-------------------+----------------+
5 rows in set (0.04 sec)
我想获取与参数化查询匹配的所有订单行(我的代码将传入 customer_id),以及客户表中的客户名称。
我怎么做?