真的不知道这个join语句错在哪里了,请各位看看,到底是哪里写不对。每次定义名称都会出现问题。
代码如下
select
d_u.station_code 站场编码,
d_u.station_name 站场名称,
d_u.partner_name 用户名称,
d_u.point_code,
d.minimum_supply_pressure 最低供气压力,
from partner_direct_user d_u JOIN item_prod.pipechina_point d
on d_u.station_code= d.station_code
where
item_prod.pipechina_point.type ='0'
and
item_prod.pipechina_point.status
='0'
报错
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from partner_direct_user d_u JOIN item_prod.pipechina_point d
on d_u.station_co' at line 7
最低供气压力, 后面这个逗号去掉
select与from之间的最后一个字段后面不需要逗号,正确应该是:
SELECT
d_u.station_code 站场编码,
d_u.station_name 站场名称,
d_u.partner_name 用户名称,
d_u.point_code,
d.minimum_supply_pressure 最低供气压力
FROM
partner_direct_user d_u
JOIN item_prod.pipechina_point d ON d_u.station_code = d.station_code
WHERE
item_prod.pipechina_point.type = '0'
AND item_prod.pipechina_point.STATUS = '0'
逗号是用来隔开各个列的
from 之前不要再有逗号