You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

多表LEFT JOIN中左右表判定——以Country、city、customer表为例

LEFT JOIN 表关系解析

先看执行的SQL语句:

SELECT country.country_name_eng, city.city_name, customer.customer_name
FROM Country
LEFT JOIN city ON city.country_id = country.id
LEFT JOIN customer ON customer.city_id = city.id

针对问题逐一解答:

  • city表的左表:Country表
  • Country表的右表:city表
  • customer表的左表:是Country和city做左连接后的结果集(若仅看直接关联的基础表,也可理解为city表)
  • customer表的右表:无,该查询中customer是最后一次JOIN的右表,后续没有关联其他表

内容的提问来源于stack exchange,提问作者Sudarshan Patil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 16:01:16