Wednesday, 15 June 2011

SQLite: How to select only the filename without extension? -



SQLite: How to select only the filename without extension? -

i need extract filename without extension 1 of tables have.

currently have used

select filename files

is used returns entire filename (jessica.timber.mp3). possible filename using sqlite(eg: jessica.timber )? files may contain multiple "." lastly dot followed the ext should removed.

i tried next query, provides result if extension 3 letter long (eg: *.mp3) fails if more (eg: *.flac)

select substr(filename, -4, -100) files;

sqlite has no built-in string functions help this.

it possible create recursive cte, easiest way retrieve entire file name , remove extension in code.

sqlite

No comments:

Post a Comment