无法将 SoQL 查询与 Socrata 组合在一起

Zer*_*tas 2 soda socrata

我在测试数据库中将这个查询放在 MySQL 中,并试图弄清楚如何将它移植到 SoQL SODA API。几乎只是想获得一份独特业务和相关详细信息的列表。

SELECT DISTINCT
    (CAMIS), dba, boro, building, street
FROM
    nyc_stuff.restauraunt_inspections
WHERE
    BORO = 'BRONX';
Run Code Online (Sandbox Code Playgroud)

这是我正在使用的基本网址:

https://data.cityofnewyork.us/resource/xx67-kt59.json

我知道如何使用clauses,但无法弄清楚如何将 Distinct 添加到查询中。

我厌倦了这个:

https://data.cityofnewyork.us/resource/xx67-kt59.json ?$select=DISTINCT%20(CAMIS)

但没有运气...

小智 5

您可以通过使用 SoQL 中的 $query 参数来完成此操作。我会建议:

https://data.cityofnewyork.us/resource/xx67-kt59.json?$query=SELECT%20distinct%20camis,%20dba,%20boro,%20building,%20street%20WHERE%20boro%20=%20%22BRONX%22
Run Code Online (Sandbox Code Playgroud)

谢谢, Socrata 支持