2012-06-19 56 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 '%.%'; 
相关问题