sel ect * fr om (select scsbxx_mc as sbmc,u_scbq_scxlh,U_SCBQ_SCRGH,wlsx_sxzf05 as xh,wlsx_sxzf06 as gg,wlsx_sxzf04 as pj,wlsx_sxzf01 as wlh,wlsx_sxzf02 as yhm
,wlsx_sxzf03 as ys,u_cpczrk_wlxh,u_cpczrk_ph,u_cpczrk_jz,u_cpczrk_jyrq,StartTime,EndTime,u_scbq_woid,u_scbq_jhid,u_scbq_scsbid,u_scbq_pch,u_scbq_pchqz,jgtm,zletm,kletm,ZFaultTotal,KFaultTotal,nFlaw_Number,nC_Number,nD_Number,nCD_Number,nElse_Number,fLength,ZZL,ZFaultAlarms,KFaultAlarms,Start,Stop,Length,fDiameter1,fDiameter2,nFlawNumber,nCFlawNumber,nCDFlawNumber,volume,online,downline,leng,speed,alarm,bigalarm,pitsalarm,scratchalarm,chromaticalarm,u_cpczrk_zf
fr om {U_SCBQ} left join {RPCJH}
on RPCJH_JHID = U_SCBQ_JHID
le ft Join {SCSBXX} on SCSBXX_SCSBID = RPCJH_SCSBID
le ft join {wlsx} on wlsx_wlid = rpcjh_wlid
le ft join {u_jcjl} on u_scbq_scxlh = scxlh
le ft join {u_cpczrk} on u_scbq_scxlh = u_cpczrk_scxlh) a
le ft join (select SCXLH,TM,MC,LOT,FEEDTIME,GH,F1,F3,TSBH fro m {U_YCL} where lb = '铜杆') as b ON b.SCXLH = a.u_scbq_scxlh
le ft join (select SCXLH fr om {U_YCL} where lb = '底层') as c ON c.SCXLH = a.u_scbq_scxlh
这个查询语句不知道啥问题? 报错显示“)”附近有语法错误。
主要是 left join (sele ct SCXLH fr om {U_YCL} where lb = '底层') as c ON c.SCXLH = a.u_scbq_scxlh 这个加进去后报错,这段没加进去是正常的。
这个是同一张表根据查询的不同条件结果进行关联的,原先的表,进行横向拼接
就是最后一个LEFT JOIN 加进去后报错,前面写的测试过没问题
把sql去掉大括号,放到后台数据库里执行看提示什么错误
SQL数据库里面没问题,我看了下应该是界面上筛选条件的问题。这个文本文件的是筛选条件,看下,是加载条件的时候出了问题,谢谢