SELECT "proxy".*, "proxyAccounts"."id" AS "proxyAccounts.id" FROM (SELECT "proxy"."id", count("proxyAccounts"."id") AS "countConnect" FROM "proxies" AS "proxy" LIMIT 1) AS "proxy" LEFT OUTER JOIN "accounts" AS "proxyAccounts" ON "proxy"."id" = "proxyAccounts"."id_proxy";
SELECT "proxy".*, "proxyAccounts"."id" AS "proxyAccounts.id" FROM (SELECT "proxy"."id", count("accounts"."id") AS "countConnect" FROM "proxies" AS "proxy" LIMIT 1) AS "proxy" LEFT OUTER JOIN "accounts" AS "proxyAccounts" ON "proxy"."id" = "proxyAccounts"."id_proxy";
models.proxy.findOne({
attributes: ['id',
[sequelize.fn('count', sequelize.col('proxyAccounts.id')), 'countConnect']
],
where: {
countConnect: {
[Op.lte]: 10
}
},
include: [{
attributes: ['id'],
model: models.accounts,
as: 'proxyAccounts'
}]
})
SELECT "proxy".*, "proxyAccounts"."id" AS "proxyAccounts.id" FROM (SELECT "proxy"."id", count("proxyAccounts"."id") AS "countConnect" FROM "proxies" AS "proxy" WHERE "proxy"."countConnect" <= 10 LIMIT 1) AS "proxy" LEFT OUTER JOIN "accounts" AS "proxyAccounts" ON "proxy"."id" = "proxyAccounts"."id_proxy";
SELECT "proxy".*, "proxyAccounts"."id" AS "proxyAccounts.id" FROM (SELECT "proxy"."id", count("accounts"."id") AS "countConnect" FROM "proxies" AS "proxy" WHERE "proxy"."countConnect" <= 10 LIMIT 1) AS "proxy" LEFT OUTER JOIN "accounts" AS "proxyAccounts" ON "proxy"."id" = "proxyAccounts"."id_proxy";
client.eval("return redis.call('lrange', 'user_3_1_15_users', 0, 10)", 0)