【发布时间】:2019-05-19 10:00:41
【问题描述】:
这是我班级的挑战。 使用 INNER JOIN 检索以下信息:
- 使用客户和订单表查找公司所有者创建的所有订单。
我想出了这个,但是当我输入它时它说空集>>>
SELECT id FROM orders INNER JOIN customers USING (id);
这些是客户表中的列。 客户
| id | company | last_name | first_name | email_address | job_title
| business_phone | home_phone | mobile_phone | fax_number | address
| city | state_province | zip_postal_code | country_region | web_page
| notes | attachments |.
这些是订单表中的列。 订单
| id | employee_id | customer_id | order_date | shipped_date | shipper_id
| ship_name | ship_address | ship_city | ship_state_province
| ship_zip_postal_code | ship_country_region | shipping_fee | taxes
| payment_type | paid_date | notes | tax_rate | tax_status_id | status_id
【问题讨论】:
-
没有人会阅读它。格式正确。 stackoverflow.com/help/how-to-ask
-
您似乎将订单 ID 与客户 ID 匹配..
-
见meta.stackoverflow.com/questions/333952/…,不要包含明显不相关的列
标签: mysql