2012-06-19 48 views

回答

10

後,不區分大小寫字符串,您可以使用SUBSTRING_INDEX:

SELECT DISTINCT substring_index(column_containing_file_names,'.',-1) FROM table 

-1意味着它將開始搜索「」從右側。

0

@bnvdarklord給出的答案是正確的,但它包含的文件名在結果集中也沒有擴展名,所以如果只希望擴展模式使用下面的查詢。

SELECT DISTINCT substring_index(column_containing_file_names,'.',-1) FROM table where column_containing_file_names like '%.%'; 
相關問題