I write query like this:
SELECT name, class, period FROM subject
WHERE organization IN (?,?,?,?,?,?,?,?)
GROUP BY class, period
But, it causing error like this:
Error 1055: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'bsi.subject.name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
I found solving from this. But, I am not so sure it safe. I am database junior. Is it safe? There is another solution without changing the sql mode setting?
I also found this solution. If column name
not necessary, just simply remove it. But, I consider to add it to reuseable code.