I have a big problem when I want to make a view.
CREATE VIEW AnneeBillet (ANNEE_BILLETS, CHIFFRES)
AS SELECT YEAR(FIN_RESERVATION), sum(TYPE.PRIX*NOMBRE)
FROM TYPE, BILLET
where TYPE.TYPE = BILLET.TYPE;
I have this error :
In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'parc.BILLET.FIN_RESERVATION'; this is incompatible with sql_mode=only_full_group_by
I have already tried many solutions like putting
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
But I'm with a docker container and I've seen that I had to modify directly the configuration file to have what I want.
Then, I found this post on stackoverflow but I can't do
--sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))
in my docker-compose because I have an error like this :
mysql_1 | 2021-04-27T07:59:53.283400Z 0 [ERROR] [MY-000077] [Server] /usr/sbin/mysqld: Error while setting value '(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))' to 'sql_mode'.
Please help me, I'm fed up with this problem.