select(case
when instr(str,'/R')>0 then
substr(str,1,instr(str,'/R')-1)
when instr(str,'/T')>0 then
substr(str,1,instr(str,'/T')-1)
else
'0'
end)
from table_name;
update: update table_name set table_name.attribute=(嵌套查询语句)
本文介绍了一种使用SQL语句来根据特定字符'/R'或'/T'截取字符串的方法,并展示了如何通过嵌套查询更新表中属性值的具体实现。
select(case
when instr(str,'/R')>0 then
substr(str,1,instr(str,'/R')-1)
when instr(str,'/T')>0 then
substr(str,1,instr(str,'/T')-1)
else
'0'
end)
from table_name;
update: update table_name set table_name.attribute=(嵌套查询语句)
您可能感兴趣的与本文相关的镜像
Stable-Diffusion-3.5
Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率
3748

被折叠的 条评论
为什么被折叠?