Is there any way to fix this request so that it works with ONLY_FULL_GROUP_BYenabled?
ONLY_FULL_GROUP_BY
SELECT LOWER(s) AS lower_s, SUM(i) AS sum_i FROM t GROUP BY 1 HAVING LENGTH(lower_s) < 5
It displays an error message
The non-group field "lower_s" is used in the HAVING clause.
Fiddle
why don't you just use where LENGTH(LOWER(s)) < 5
where LENGTH(LOWER(s)) < 5
The use seems to be havingwrong here.
having
According to sql wiki
HAVING SQL , SQL SELECT , . SQL, WHERE . [1]
HAVING . , .
:
SELECT LOWER(s) AS lower_s, SUM(i) AS sum_i FROM t WHERE LENGTH(LOWER(s)) < 5 GROUP BY 1;
SELECT LOWER(s) AS lower_s, SUM(i) AS sum_i FROM t WHERE LENGTH(lower_s) < 5 GROUP BY 1
select lower_s, SUM(i) AS sum_i from ( SELECT LOWER(s) AS lower_s, i FROM t ) dt where LENGTH(lower_s) < 5 GROUP BY lower_s
ANSI SQL- , , LOWER(s).
LOWER(s)
Source: https://habr.com/ru/post/1621065/More articles:Yii2 node how to get redis session key by user id - node.jsCss Divs Overflow - htmlProblems with CheckBox with images - checkboxA reliable way to smooth the name, description and keywords - phpGet Facebook meta tags with PHP - phpHow to choose the first default option in the selection box or drop-down list - javascript(* b) [0] vs * b [0] - Массивы и указатели - cWhat is the total number of images we can get from a common profile from instagram - instagram-apiIs this because Javascript beign is the only thread? - javascriptКак вставить данные в пакет? - sqlAll Articles