如何对sql范围查询子句进行分组

时间:2015-06-27 02:47:07

标签: postgresql navicat

构建索引时收到错误。我最近切换到PostgreSQL,我正在使用Navicat。错误来自具有邮政编码,城市,州,纬度和经度的位置表。

enter image description here

indexing index 'location_core'...
collected 84068 docs, 0.7 MB
sorted 0.1 Mhits, 100.0% done
total 84068 docs, 716268 bytes
total 0.686 sec, 1043676 bytes/sec, 122495.78 docs/sec
indexing index 'user_core'...
ERROR: index 'user_core': sql_range_query: ERROR:  column "locations.latitude" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...sers"."updated_at")::int AS "updated_at", RADIANS(locations....
                                                             ^
 (DSN=pgsql://lexi87:***@localhost:5432/dating_development).
total 0 docs, 0 bytes
total 0.007 sec, 0 bytes/sec, 0.00 docs/sec
indexing index 'user_delta'...
ERROR: index 'user_delta': sql_range_query: ERROR:  column "locations.latitude" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...sers"."updated_at")::int AS "updated_at", RADIANS(locations....

我究竟如何将它们放在group by子句中?任何帮助将不胜感激!

0 个答案:

没有答案