SELECT `id`, IF(TIMESTAMPDIFF(MINUTE, `onlineAt`, CURDATE()) <= 10, 1, 0) AS `isOnline` FROM `model` WHERE `isOnline` = 1
Неизвестный столбец 'isOnline' в 'where clause'
You can use the alias in GROUP BY, ORDER BY, or HAVING clauses.https://dev.mysql.com/doc/refman/8.0/en/problems-w...
Standard SQL disallows references to column aliases in a WHERE clause. This restriction is imposed because when the WHERE clause is evaluated, the column value may not yet have been determined.