You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ERROR 1003 - Connection {dbInstance[192.168.9.52:3306],Schema[thb_db_04],threadID[2668]} was closed ,reason is [handle data error:field not found:SUBSTRING(a.owner_com_code, 1, 2)]
#2919
执行复杂sql语句时group by 包含带有函数的列,提示有问题,找不到该列,MySQL中可以正常执行该sql语句。
group中修改函数为别名之后依然存在这个问题。
SELECT
a.ebusiness_no ebusinessNo,
min( a.plan_code ) planCode,
a.remark remark,
a.flag flag,
substring( a.owner_com_code, 1, 2 ) ownerComCode,
c1.insured_c_name bbxr,
c2.insured_c_name tbr,
a.oth_flag othFlag,
d.license_no licenseNo,
b1.update_date createDate,
b1.total_premium totalPremium,
b1.order_status orderStatus,
CASE
a.oth_flag
WHEN 'COMBINE' THEN
'xxx'
WHEN 'MOTOR' THEN
'xxx'
WHEN 'MTPL' THEN
'xxx'
END riskName,
sum( f.VALUE ) cmsn,
a.accept_area_city acceptAreaCity,
b1.START_DATE startDate,
b1.END_DATE endDate
FROM
eb_order_form b1
LEFT JOIN prp_main a ON b1.ebusiness_no = a.ebusiness_no
LEFT JOIN prp_insured c1 ON a.ebusiness_no = c1.ebusiness_no
AND c1.insured_flag = '1'
LEFT JOIN prp_insured c2 ON a.ebusiness_no = c2.ebusiness_no
AND c2.insured_flag = '2'
LEFT JOIN prp_item_car d ON a.ebusiness_no = d.ebusiness_no
LEFT JOIN prp_car_owner e ON a.ebusiness_no = e.ebusiness_no
LEFT JOIN eb_cmsn_get f ON a.ebusiness_no = f.ebusiness_no
WHERE
a.valid_status = 'Y'
AND b1.risk_code = 'xxx'
AND b1.valid_status = 'Y'
AND ( a.oth_flag = 'MOTOR' OR a.oth_flag = 'COMBINE' )
AND b1.MEMBER_CODE = 'xxx'
GROUP BY
a.ebusiness_no,
a.remark,
a.flag,
substring( a.owner_com_code, 1, 2 ),
c1.insured_c_name,
c2.insured_c_name,
a.oth_flag,
d.license_no,
b1.update_date,
b1.total_premium,
b1.order_status,
a.oth_flag,
a.update_date,
a.accept_area_city,
b1.START_DATE,
b1.END_DATE
The text was updated successfully, but these errors were encountered:
**dble version:dble-3.21.02.1-20210528041415
steps:
执行复杂sql语句时group by 包含带有函数的列,提示有问题,找不到该列,MySQL中可以正常执行该sql语句。
group中修改函数为别名之后依然存在这个问题。
SELECT
a.ebusiness_no ebusinessNo,
min( a.plan_code ) planCode,
a.remark remark,
a.flag flag,
substring( a.owner_com_code, 1, 2 ) ownerComCode,
c1.insured_c_name bbxr,
c2.insured_c_name tbr,
a.oth_flag othFlag,
d.license_no licenseNo,
b1.update_date createDate,
b1.total_premium totalPremium,
b1.order_status orderStatus,
CASE
a.oth_flag
WHEN 'COMBINE' THEN
'xxx'
WHEN 'MOTOR' THEN
'xxx'
WHEN 'MTPL' THEN
'xxx'
END riskName,
sum( f.VALUE ) cmsn,
a.accept_area_city acceptAreaCity,
b1.START_DATE startDate,
b1.END_DATE endDate
FROM
eb_order_form b1
LEFT JOIN prp_main a ON b1.ebusiness_no = a.ebusiness_no
LEFT JOIN prp_insured c1 ON a.ebusiness_no = c1.ebusiness_no
AND c1.insured_flag = '1'
LEFT JOIN prp_insured c2 ON a.ebusiness_no = c2.ebusiness_no
AND c2.insured_flag = '2'
LEFT JOIN prp_item_car d ON a.ebusiness_no = d.ebusiness_no
LEFT JOIN prp_car_owner e ON a.ebusiness_no = e.ebusiness_no
LEFT JOIN eb_cmsn_get f ON a.ebusiness_no = f.ebusiness_no
WHERE
a.valid_status = 'Y'
AND b1.risk_code = 'xxx'
AND b1.valid_status = 'Y'
AND ( a.oth_flag = 'MOTOR' OR a.oth_flag = 'COMBINE' )
AND b1.MEMBER_CODE = 'xxx'
GROUP BY
a.ebusiness_no,
a.remark,
a.flag,
substring( a.owner_com_code, 1, 2 ),
c1.insured_c_name,
c2.insured_c_name,
a.oth_flag,
d.license_no,
b1.update_date,
b1.total_premium,
b1.order_status,
a.oth_flag,
a.update_date,
a.accept_area_city,
b1.START_DATE,
b1.END_DATE
The text was updated successfully, but these errors were encountered: