MySQL 插入问题:#1136 - 列数与第 1 行的值数不匹配
MySQL Insert Issue : #1136 - Column count doesn't match value count at row 1
Im trying to input value of continous counting debit-kredit into saldo column, heres my sql code
I want to do debit - kredit and put in saldo column, my query above allows me to retrieve saldo values but not failed on inserting
SET @variable = 0;
-- Without Pagination
INSERT into laporan_bukubesar (`saldo`)
SELECT `tanggal`, `debit`, `kredit`, @variable := @variable + (`debit` - `kredit`) as `saldo`
FROM laporan_bukubesar
ORDER BY `tanggal` ASC;
#1136 - Column count doesn't match value count at row 1
Heres my table
Heres what i want
是否要更新值:
UPDATE laporan_bukubesar
SET saldo = (@variable := @variable + (`debit` - `kredit`))
ORDER BY tanggal ASC;
Im trying to input value of continous counting debit-kredit into saldo column, heres my sql code
I want to do debit - kredit and put in saldo column, my query above allows me to retrieve saldo values but not failed on inserting
SET @variable = 0;
-- Without Pagination
INSERT into laporan_bukubesar (`saldo`)
SELECT `tanggal`, `debit`, `kredit`, @variable := @variable + (`debit` - `kredit`) as `saldo`
FROM laporan_bukubesar
ORDER BY `tanggal` ASC;
#1136 - Column count doesn't match value count at row 1
Heres my table
Heres what i want
是否要更新值:
UPDATE laporan_bukubesar
SET saldo = (@variable := @variable + (`debit` - `kredit`))
ORDER BY tanggal ASC;