INSTR() 和 CHARINDEX() 有什么区别吗?

Fae*_*egy 6 sql-server oracle

我想知道之间是否存在差异(除了引擎兼容性和可选发生之外)

CHARINDEX (expressionToFind ,expressionToSearch [, start_location])
Run Code Online (Sandbox Code Playgroud)

INSTR (string , substring [, position [, occurrence]])
Run Code Online (Sandbox Code Playgroud)

谢谢。

Fae*_*egy 5

用途:INSTR( string1, string2 [, start_position [, nth_appearance ] ] )
用途:CHARINDEX ( expression1 , expression2 [ , start_location ] )

-来源

除了它运行的DBMS的差异之外CHARINDEXINSTRnth_appearance不能使用CHARINDEX.