数据库中出现错误:1054 - Unknown column 'bus_car.car_id' in 'on clause'

原sql为:

SELECT
bus_car.car_id,
bus_car.car_name,
bus_customer.customer_id,
bus_customer.cust_name,
bus_rent.rent_id,
bus_rent.begin_date,
bus_rent.end_date,
bus_rent.price,
bus_rent.rent_flag,
bus_rent.oper_name,
bus_rent.rent_time,
bus_rent.rent_remark,
bus_customer.phone,
bus_customer.identity,
bus_customer.sex,
bus_customer.driver_license,
bus_car.car_color
FROM
bus_car ,
bus_customer
INNER JOIN bus_rent ON bus_rent.car_id = bus_car.car_id AND bus_rent.customer_id = bus_customer.customer_id

给from后的两个表加上括号即可

SELECT
bus_car.car_id,
bus_car.car_name,
bus_customer.customer_id,
bus_customer.cust_name,
bus_rent.rent_id,
bus_rent.begin_date,
bus_rent.end_date,
bus_rent.price,
bus_rent.rent_flag,
bus_rent.oper_name,
bus_rent.rent_time,
bus_rent.rent_remark,
bus_customer.phone,
bus_customer.identity,
bus_customer.sex,
bus_customer.driver_license,
bus_car.car_color
FROM
(bus_car ,
bus_customer)
INNER JOIN bus_rent ON bus_rent.car_id = bus_car.car_id AND bus_rent.customer_id = bus_customer.customer_id
数据库中出现错误:1054 - Unknown column 'bus_car.car_id' in 'on clause'数据库中出现错误:1054 - Unknown column 'bus_car.car_id' in 'on clause' 对,是我 发布了55 篇原创文章 · 获赞 14 · 访问量 6195 私信 关注
上一篇:【RAC】11g R2 RAC新特性之Highly Available IP(HAIP)


下一篇:Docker 之 四种网络模型