Trying to update the "size" column with the value of "file" column.
BEGIN
set NEW.size=SUM(LENGTH(file));
END
Executing:
UPDATE `table`.`library` SET `_by`='Danis555, Vovan244' WHERE `id`='20';
Operation failed: There was an error while applying the SQL script to the database.
ERROR 1111: 1111: Invalid use of group function SQL Statement: UPDATE
table
.library
SET_by
='Danis555, Vovan244' WHEREid
='20'
Marco
3,7205 gold badges25 silver badges31 bronze badges
1 Answer 1
SET NEW.size = LENGTH(OLD.file);
No SUM
, since there is only one row.
Specify which file
with OLD.
.
answered May 8, 2017 at 17:46
lang-sql
SUM(LENGTH())
?LENGTH
s do you expect to be returned for one column in one row that you need toSUM
them?