BEGIN
#Routine body goes here...
INSERT INTO EMS_PM_STORAGE (
AMOID,
GP_BEGIN_TIME,
EMS_RECORD_TIME,
ZDC_L_LODA
) SELECT
epl.AMOID,
epl.GP_BEGIN_TIME,
TIMESTAMPDIFF(
MINUTE,
epl.GP_BEGIN_TIME,
MAX(epl.LOG_TIME)
) - 15 RECORD_TIME2,
TIMESTAMPDIFF(
MINUTE,
epr.GP_BEGIN_TIME,
MAX(epr.RECORD_TIME)
) - 15 ZDC_L_LODA
FROM
EMS_PM_LOG epl,EMS_PM_REPORT epr
WHERE
epl.AMOID=epr.AMOID AND epl.GP_BEGIN_TIME=epr.GP_BEGIN_TIME
GROUP BY
epl.AMOID,
epr.GP_BEGIN_TIME; END
相关文章
- 03-22update pm storage
- 03-22Kubernetes1.20.5 gitlab13.6 update13.10
- 03-22SQL更新语句,Error Code: 1175. You are using safe update(在进行视图更新的时候遇到)
- 03-22POJ 2398 Toy Storage (二分 叉积)
- 03-22POJ 2398 计算几何之Toy Storage
- 03-22Nginx下使用RESTful的UPDATE与DELETE发生405错误的解决方法
- 03-22显式锁select for update 用法
- 03-22for update
- 03-22git pull fails “unable to resolve reference” “unable to update local ref”
- 03-22INSERT 中ON DUPLICATE KEY UPDATE的使用