SQL to select filename component of path

The following works on MySQL to extract base filename component of a complete file path.

SELECT REVERSE(
  SUBSTRING(
    REVERSE(filepath),1,
      LOCATE("/",REVERSE(filepath)
    ) - 1
 )
) as basename
FROM Table
category: misc
<< prev
Stance Robot v2
^ up ^
Blog Index
next >>
Design Idea