sql compilation error 3a is not a valid group by expression

Solutions on MaxInterview for sql compilation error 3a is not a valid group by expression by the best coders in the world

showing results for - "sql compilation error 3a is not a valid group by expression"
Izzy
26 Jun 2020
1SELECT a, b, sum(c) FROM my_table GROUP BY a;		-- Error
2SELECT a, b, sum(c) FROM my_table GROUP BY a, b;	-- OK, all expressions there
3-- CASE WHEN statement, for example:
4SELECT a, CASE WHEN b=1 THEN 'Ok' ELSE 'Ko' END AS r, sum(c) 
5FROM my_table
6GROUP BY a, CASE WHEN b=1 THEN 'Ok' ELSE 'Ko' END;		-- No alias name (r)
similar questions
error 3a column 22hourly visitors hour 22 must appear in the group by clause or be used in an aggregate functionerror code 3a 1055 expression 231 of order by clause is not in group by clause and contains nonaggregated column 5c 5c which is not functionally dependent on columns in group by clause 3b this is incompatible with sql mode 3donly full group bysql group by errorwhere not regex in sqlselect list is not in group by clausef select list is not in group by clause and contains nonaggregated column 27safir erp online ro rft2020 leave requests end at 27 which is not functionally dependent on columns in group by clause 3b this is incompatible with sql mode 3donly full group by on linsqlstate 5b42000 5d 3a syntax error or access violation 3a 1140 mixing of group columns 28min 28 29 2cmax 28 29 2ccount 28 29 2c 29 with no group columns is illegal if there is no group by clausegroup by clause 3b this is incompatible with sql mode 3donly full group bythis is incompatible with sql mode 3donly full group byexpression number 1 of select list is not in group by clauseerror code 3a 1055 expression 232 of select list is not in group by clause and contains nonaggregated column 27mydb term year 27 which is not functionally dependent on columns in group by clause 3b this is incompatible with sql mode 3donly full group byelect list is not in group by clause and contains nonaggregated column 27schogdsw db se name 27 which is not functionally dependent on columns in group by clause 3b this is incompatible with sql mode 3donly full group byerror expression select list not group by nonaggregated column 2fselect list is not in group by clause and contains nonaggregated column codeigniter