私はRORアプリケーションに取り組んでおり、PostgreSQLデータベースでHstoreを使用しています.テーブルでHstoreキーでグループ化できるかどうか尋ねています??
これは私がしました :
select state , count(*) from infractions group by details -> 'commune';`
しかし、私はこのエラーが発生します:
column "infractions.state" must appear in the GROUP BY clause or be used in an aggregate function
details は Hstore 列で、彼女は私の詳細の例です:
"adress"=>"", "commune"=>"14", "province"=>"6", "description"=>"Ce fichier est sous licence Creative Commons"
ありがとう