我想在Sequalize上使用以下MYSQL查询。我如何使之成为可能?
INSERT INTO data_tree (parent_id, child_id, depth)
SELECT parent_id, NEW.id, depth + 1)
FROM data_tree
WHERE child_id = NEW.parent_id;
答案 0 :(得分:0)
就像使用一样简单
sequelize.query(yourQuery).spread((result, meta) => {
// handle result
});