when I execute the INSERT INTO account values(110,1250);
statement on the following table
+--------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+------------+------+-----+---------+-------+
| acc_no | int(11) | YES | | NULL | |
| amount | bigint(20) | YES | | NULL | |
+--------+------------+------+-----+---------+-------+
I get this error
ERROR 1054 (42S22): Unknown column 'amount' in 'field list'
what can be the cause of it?
Trigger code is
create trigger demo before insert on account
for each row
set @diff=@diff+amount;
As I am learning triggers so I used a basic trigger defination
You have to put code like this:
If you select varchar in mysql then it should be string. if you select INT in mysql then no need put ''.