Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在某个表达式上拆分一个 varchar 列并保留结果的左侧。
我的专栏如下所示:
我想拆分双下划线 ( '__') 上的所有字符串并保留它之前的任何内容。这如何在 SQLite 中完成?
'__'
您可以使用:
select substr(varchar_col, 1, instr(varchar_col, '__') - 1)
这是一个 db<>fiddle。