TEXT 类型的列 tasumma 包含行。注释的开头在行首用两个 ** 字符标记。从这里开始到列尾的所有文本都应该被忽略。如何在推荐行之前返回文本。例如,如果列包含文本
2*31
** This is multiline
comment starting with ** characters in start of line
必须返回 2*31
我试过表达
CASE when tasusumma like '%**%' then
substring( tasusumma for position( '**' in tasusumma)-1)
else tasusumma end
但它看起来有点难看。
在 Postgres eq 中使用 regexp substring 有更好的方法吗?