[Postgres] LastIndexOf 함수

2022. 12. 13. 16:27프로그램개발/Database

 

CREATE OR REPLACE FUNCTION LastIndexOf(text,char) 
RETURNS integer LANGUAGE SQL AS $$  
select LENGTH($1) - strpos(reverse($1),$2)
$$;

 

반응형