Mysql

mysql将查询结果批量插入到另外一张表中

INSERT INTO TPersonnelChange(
    UserId,
    DepId,
    SubDepId,
    PostionType,
    AuthorityId,
    ChangeDateS,
    InsertDate,
    UpdateDate,
    SakuseiSyaId
)SELECT
    UserId,
    DepId,
    SubDepId,
    PostionType,
    AuthorityId,
    DATE_FORMAT(EmployDate, '%Y%m%d'),
    NOW(),
    NOW(),
    1
FROM
    TUserMst
WHERE
    `Status` = 0

留言

您的电子邮箱地址不会被公开。 必填项已用*标注