POSTGRESQL中的CHARINDEX(SQL SERVER)等价物是什么?

Man*_*jan 14 postgresql charindex

CHARINDEX在Postgresql 尝试.但它说:

function CHARINDEX() does not exist
Run Code Online (Sandbox Code Playgroud)

如果postgresql中不存在这样的内置函数,那么是否有任何函数可以替代charindex?
如果是,CHARINDEXPOSTGRESQL中的(SQL SERVER)等价物是什么?

use*_*r_0 24

postgresql中的等价函数是:

strpos(string, substring)
Run Code Online (Sandbox Code Playgroud)

要么:

position(substring in string)
Run Code Online (Sandbox Code Playgroud)

它们是等价的,只是参数的顺序不同.
如果还需要参数start_location,则需要将子字符串传递给strpos.

您可以在以下网址找到它们:http://www.postgresql.org/docs/9.4/static/functions-string.html