sql - SQL 正则表达式抛出状态=42000,代码=40000
问题描述
case regexp_extract(network_information,'^([\\w|-]+)[.|;].*',1) then .........
对于这部分代码,我得到ParseException line 22:2 cannot identify input near '*' ',' 'case' in expression specification (state=42000,code=40000) 谁能帮帮我。
解决方案
regexp
看起来挺好的。案例是错误的。它应该是这样的:
case when regexp_extract(network_information,'^([\\w|-]+)[.|;].*',1) = 'something'
then ...
end
或者像这样:
case regexp_extract(network_information,'^([\\w|-]+)[.|;].*',1)
when 'something' then ...
when 'something-else' then ...
end
推荐阅读
- wpf - 有条件的绑定值
- spring - Ldap Auth 作为 Rest 控制器
- android - 如何让 R8 + proguard-android-optimize.txt + Google Drive API 无缝运行?
- bash - Bash - 将变量扩展为另一个变量名
- python - Django ORM 对 QuerySet 的迭代真的很慢
- jhipster - 创建蓝图时如何覆盖needle API?
- sql - 从表中选择最大日期
- laravel - Laravel Storage::download 在路径中找不到文件
- reactjs - 将 React DirectLine Bot Framework 通道与 SPFX 应用程序定制器一起使用时出错
- javascript - 如何阻止整个 React UI?