放在一般的数据库就能执行,可以看下效果。
SELECT INSTR(’字符串1‘, ’字符串2‘属于’字符串1‘中的一个, 从’字符串1‘中第几个开始, 开始后的第几个‘字符串2’) FROM 表;
SELECT INSTR (STRING, STRING1 in STRING, the counter, the byter)
FROM the table;
SELECT LENGTH ('abkdajlkgjlaskjglkdjieahg')
FROM DUAL;--will return 5
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a')
FROM DUAL;-- will return 1
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a', 1, 1)
FROM DUAL;-- will return 1
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a', 1, 2)
FROM DUAL;--will return 5
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a', 1, 3)
FROM DUAL;--will return 12
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a', 1, 4)
FROM DUAL;--will return 23
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a', 2, 1)
FROM DUAL;--will return 5
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a', 2, 2)
FROM DUAL;--will return 12
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a', -1, 1)
FROM DUAL;--will return 23
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a', -1, 2)
FROM DUAL;--will return 12
SELECT INSTR ('abkdajlkgjlaskjglkdjieahg', 'a', -2, 3)
FROM DUAL;--will return 5