【问题标题】:How to set a condition filter on a string type field of a table?如何对表的字符串类型字段设置条件过滤器?
【发布时间】:2021-08-26 08:01:04
【问题描述】:

表格内容如下:

id = 0..4
tag = `FB`IBM`FB`IBM`AMZN
t =table(id, tag)
id tag
0 FB
1 IBM
2 FB
3 IBM
4 AMZN

表的架构如下:

t.schema().colDefs
name typeString typeInt comment
id INT 4
Tag STRING 8

我要过滤包含“IBM”的标签字段,SQL语句怎么写?

【问题讨论】:

    标签: database-design dolphindb


    【解决方案1】:

    使用 regexFind 函数,示例如下:

    select * from t where regexFind(tag, `IBM) != -1
    

    结果:

    id tag
    1 IBM
    3 IBM

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-11
      • 1970-01-01
      • 2014-11-02
      相关资源
      最近更新 更多