我使用MYSQL工作台编写此查询,将数据插入一个数据库到另一个数据库,但它不起作用,你能帮我解决这个问题吗?
USE att2000;
创建触发器trgAfterInsert 在CHECKINOUT上插入每一行后
INSERT INTO orangehrm_mysql.ohrm_attendance_record(employee_id,punch_in_utc_time) values(USERID,CHECKTIME);
SELECT
checkinout.USERID, checkinout.CHECKTIME
FROM
CHECKINOUT
WHERE
HOUR(CHECKTIME) < 12;
INSERT INTO orangehrm_mysql.ohrm_attendance_record(employee_id,punch_out_user_time) values(USERID,CHECKTIME);
SELECT
checkinout.USERID, checkinout.CHECKTIME
FROM
CHECKINOUT
WHERE
HOUR(CHECKTIME) >= 12;
答案 0 :(得分:0)
尝试不使用values
INSERT INTO orangehrm_mysql.ohrm_attendance_record(employee_id,punch_in_utc_time)
(
SELECT
checkinout.USERID, checkinout.CHECKTIME
FROM
CHECKINOUT
WHERE
HOUR(CHECKTIME) < 12
);
INSERT INTO orangehrm_mysql.ohrm_attendance_record(employee_id,punch_out_user_time)
(
SELECT
checkinout.USERID, checkinout.CHECKTIME
FROM
CHECKINOUT
WHERE
HOUR(CHECKTIME) >= 12
);
答案 1 :(得分:0)
你去:
$$sub['key'] = $sub['value'];