目次
こんなエラー
ERROR 1055 (42000): Expression #61 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'a.test.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
eager_loadではエラーになるが、left_joinsならエラーにならない
このqiitaみて分かったけどeager_loadだと他のカラムも取得しようとしてgroupできずに怒られるんやね
https://qiita.com/k0kubun/items/80c5a5494f53bb88dc58
とりあえずeager_loadでいいやろ(ハナホジ)
とかいって適当に書いてすみませんでした。
結論
こういう場合はleft_joinsしよう!

babu
勉強します(´;ω;`)ウッ…
![]() |
