【发布时间】:2018-01-08 20:42:04
【问题描述】:
有人可以帮我弄清楚这个查询有什么问题吗?
https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed
失败,错误代码:query.soql.type-mismatch
表格的“速度”列被声明为文本。我无法将速度转换为实数(十进制)进行比较。谢谢
【问题讨论】:
有人可以帮我弄清楚这个查询有什么问题吗?
https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed
失败,错误代码:query.soql.type-mismatch
表格的“速度”列被声明为文本。我无法将速度转换为实数(十进制)进行比较。谢谢
【问题讨论】:
尝试使用::number 投射列,如下所示:
GET https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed::number > 31.69
【讨论】:
把数字放在括号里,像这样:
https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed
或者如果你需要它的 url 编码,使用这个:
https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed%3C%2210%22
【讨论】: