【问题标题】:how to convert text to number in a SOQL query?如何在 SOQL 查询中将文本转换为数字?
【发布时间】:2018-01-08 20:42:04
【问题描述】:

有人可以帮我弄清楚这个查询有什么问题吗?

https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed

失败,错误代码:query.soql.type-mismatch

表格的“速度”列被声明为文本。我无法将速度转换为实数(十进制)进行比较。谢谢

【问题讨论】:

    标签: socrata soda


    【解决方案1】:

    尝试使用::number 投射列,如下所示:

    GET https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed::number > 31.69
    

    【讨论】:

      【解决方案2】:

      把数字放在括号里,像这样:

      https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed

      或者如果你需要它的 url 编码,使用这个:

      https://data.cityofnewyork.us/resource/i4gi-tjb9.json?$where=speed%3C%2210%22

      【讨论】:

        猜你喜欢
        • 2021-06-14
        • 2016-01-31
        • 2011-08-23
        • 1970-01-01
        • 1970-01-01
        • 2012-11-26
        • 1970-01-01
        • 1970-01-01
        • 2010-11-20
        相关资源
        最近更新 更多