我有这样的语法
SELECT
b.buyer_id
FROM order_buyer b
WHERE
EXISTS (SELECT 1 FROM order_buyer d
WHERE d.buyer_id = b.buyer_id AND
d.createdAt >= '2018-10-01' AND d.createdAt < '2019-01-01') AND
EXISTS (SELECT 1 FROM order_buyer d
WHERE d.buyer_id = b.buyer_id AND
d.createdAt >= '2018-10-01' AND d.createdAt < '2019-01-01' ) AND
NOT EXISTS (SELECT 1 FROM order_buyer d
WHERE d.buyer_id = b.buyer_id AND d.createdAt < '2018-10-01') group by buyer_id
如何使此语法的结果(即count的值)插入到我的新表中
答案 0 :(得分:0)
INSERT INTO New_Table SELECT(然后剩下的语句)