Description:
using database version mysql 5.7.28
but linq to sql query
from data in context.Table_A
where data.userID == userID
group data by data.grade into g
select new { value = g.Sum(x => x.grade) };
SELECT COALESCE(SUM(CAST(`u`.`grade` AS int)), 0) AS `value`
FROM `Table_A` AS `u`
WHERE `u`.`userID` = @__userID_0
GROUP BY `u`.`grade`
exception: MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
mysql 5.7.28 not supported int
How to repeat:
using database version mysql 5.7.28
but linq to sql query
from data in context.Table_A
where data.userID == userID
group data by data.grade into g
select new { value = g.Sum(x => x.grade) };
SELECT COALESCE(SUM(CAST(`u`.`grade` AS int)), 0) AS `value`
FROM `Table_A` AS `u`
WHERE `u`.`userID` = @__userID_0
GROUP BY `u`.`grade`
exception: MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
mysql 5.7.28 not supported int