【问题标题】:PostgreSQL split string with comma seraprated ints into comma separated intsPostgreSQL 用逗号分隔的整数将字符串拆分为逗号分隔的整数
【发布时间】:2019-11-08 09:41:48
【问题描述】:

我得到了“1,2,3,4,5”作为参数。我想在没有东西的地方使用它(1,2,3,4,5) 如何在程序内部转换?

【问题讨论】:

    标签: sql postgresql split type-conversion


    【解决方案1】:

    您可以将其转换为数组:

    where something <> ALL (string_to_array('1,2,3,4,5', ',')::int[])
    

    假设something 是一个整数。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-08
      • 1970-01-01
      • 2015-03-07
      • 2021-02-24
      • 1970-01-01
      • 2018-12-21
      • 1970-01-01
      相关资源
      最近更新 更多