3 Replies
my table actions are not working this is the code i am using
error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'plan_partner_payments.id' in 'where clause' (Connection: mysql, SQL: select CC.*, @cumulative_balance:=@cumulative_balance + CC.credit-CC.debit AS balance from ( SELECT -1 as id, -1 as plan_partner_id, -1 as plan_id, partner_id, DATE_SUB('2023-08-08', INTERVAL 1 YEAR) as date, CASE WHEN SUM(credit)-SUM(debit) < 0 THEN SUM(credit)-SUM(debit) ELSE 0 END as debit, CASE WHEN SUM(credit)-SUM(debit) >= 0 THEN SUM(credit)-SUM(debit) ELSE 0 END as credit FROM plan_partner_payments WHERE partner_id = 3 AND date < DATE_SUB('2023-08-08', INTERVAL 1 YEAR) UNION ALL SELECT id, plan_partner_id, plan_id, partner_id, date, debit, credit FROM plan_partner_payments WHERE partner_id = 3 AND date >= DATE_SUB('2023-08- 08', INTERVAL 1 YEAR) ) CC JOIN (SELECT @cumulative_balance:=0) r where
plan_partner_payments
.id
= 54 order by CC
.date
asc limit 1)Flare
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'plan_partner_payments.id' in 'where clause' (Connection: mysql, SQL: select CC.*, @cumulative_balance:=@cumulative_balance + CC.credit-CC.debit AS balance from (
SELECT -1 as id, -1 as plan_partner_id, -1 as plan_id, partner_id, DATE_SUB('2023-08-08', INTERVAL 1 YEAR) as date,
...
this solves the problem