7253-devToTest_2418 #2350
|
@ -16,17 +16,18 @@ BEGIN
|
|||
|
||||
DROP TEMPORARY TABLE IF EXISTS tCreditClients;
|
||||
CREATE TEMPORARY TABLE tCreditClients
|
||||
SELECT clientFk, IF (credit > recovery ,credit - recovery,0) newCredit
|
||||
SELECT clientFk, IF(credit > recovery, credit - recovery, 0) newCredit
|
||||
FROM (
|
||||
SELECT r.clientFk,
|
||||
r.amount recovery,
|
||||
timestampadd(DAY, r.period, sub2.created) deadLine,
|
||||
(sub2.created + INTERVAL r.period DAY) deadLine,
|
||||
sub2.amount credit
|
||||
FROM recovery r
|
||||
JOIN (
|
||||
SELECT clientFk, amount , created
|
||||
SELECT clientFk, amount, created
|
||||
FROM (
|
||||
SELECT * FROM clientCredit
|
||||
SELECT clientFk, amount, created
|
||||
FROM clientCredit
|
||||
ORDER BY created DESC
|
||||
LIMIT 10000000000000000000
|
||||
) sub
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- Place your SQL code here
|
||||
UPDATE bs.nightTask SET `schema`='vn' WHERE id=22;
|
||||
UPDATE bs.nightTask SET `schema`='vn' WHERE `procedure`='raidUpdate';
|
||||
|
||||
UPDATE bs.nightTask SET `schema`='vn',`procedure`='creditRecovery' WHERE id=30;
|
||||
UPDATE bs.nightTask SET `schema`='vn',`procedure`='creditRecovery' WHERE `procedure` ='recobro_credito';
|
Loading…
Reference in New Issue