将此Postgres查询转换为续集

时间:2019-10-17 17:04:37

标签: postgresql sequelize.js

嗨,我正在尝试将查询转换为序列查询,但我无法做到这一点,

查询为:

SELECT SUM(od."totalValue") AS total FROM "OrderDetails" AS od
LEFT JOIN "Orders" AS o ON od."orderId" = o.id
WHERE o."orderDate" >= '2019-10-17 00:00:00' AND o."orderDate" <= '2019-10-17 23:59:59' AND o."customerId" = 47085 AND (o.status = 'delivered' OR o.status = 'pending')
AND o."queueLastStep" <> 'header/failed' AND o."queueLastStep" <> 'header/retry' AND o."queueLastStep" IS NOT NULL;

如果有人可以帮忙

0 个答案:

没有答案