sql如何获取字符串中的指定字符?
1,创建一个测试表,
创建表test _ int(value varchar 2(50));
2.插入测试数据
insert into test _ int values(' asdfdsf?d=123。ewv’);
插入到test_int值(' qwer?d = 234’);
insert into test_int值(' asfdwe?d = 234 & ampdhe Wu’);
insert into test _ int values(' adfasf?d = 25 & ampreuw’);
insert into test_int值(' afhkashf ');
提交;
3.查询表中的合计数据,select t.*,rowid from test _ int t;
4.编写sql以获取字符串中的指定字符;?
选择t.*,
情况
?当instr(value,' d=') = 0时,则
?空
?其他
?substr(值,
?instr(值,' d= '),
?情况
when instr(value,& amp)= 0那么
10
其他
instr(值,' & amp')- instr(值,' d= ')
?结束)
结束a
from test _ int t;