Sử dụng substring_index select substring_index('http://www.example.com/dev/archive/examples/test.htm','/',-1)