What is the CHARINDEX (SQL SERVER) equivalent in POSTGRESQL?
问题 I am trying CHARINDEX in Postgresql. But it says: function CHARINDEX() does not exist If no such inbuilt function exists in postgresql, then is there any function that serves as an alternative to charindex? If yes, What is the CHARINDEX (SQL SERVER) equivalent in POSTGRESQL ? 回答1: The equivalent function in postgresql is: strpos(string, substring) Or: position(substring in string) They are equivalent, just with different order in parameters. If you also need parameter start_location, you will