Is there any familiar function for PATINDEX of mysql for postgresql. I'm trying to make a sql like this in postgres.
SELECT PATINDEX('%schools%', 'W3Schools.com');
which throw an error:
no function matches the given name and argument types. you might need to add explicit type casts
To be more detailed, I'm trying to get seperate number part and string part of a string in Postgresql. I found example like this:
SELECT Section
FROM dbo.Section
ORDER BY LEFT(Section, PATINDEX('%[0-9]%', Section)-1), -- alphabetical sort
CONVERT(INT, SUBSTRING(Section, PATINDEX('%[0-9]%', Section), LEN(Section))) -- numerical