zihaoAK47 commented on issue #27922:
URL:
https://github.com/apache/shardingsphere/issues/27922#issuecomment-1666384662
@S126gj Hi, based on the SQL you defined in XML, it seems that your subquery
requires an alias. Incorrect SQL will not be parsed correctly
SELECT DATE (begin_time) AS date,
IFNULL(end_time, NOW()) AS sortEndTime,
SUM (duration) AS workDuration,
SUM (CASE WHEN machine_state != '关机' THEN duration ELSE 0 END)
AS energizeDuration,
SUM (product_number - product_number_begin) AS productNum,
AVG (avg_speed) AS avgSpeed,
(case when #{bestSpeed,jdbcType=DOUBLE}!= 0 then AVG(avg_speed)
/ #{bestSpeed,jdbcType=DOUBLE} else 0 end) AS ep
FROM (
SELECT *
FROM box_run WHERE box_code = #{boxCode,jdbcType=VARCHAR}
)
GROUP BY DATE (begin_time)
ORDER BY begin_time DESC, sortEndTime DESC;
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]