The following query extracts the last two parts from a url. I want to extract the second last part from the url excluding the last.
SELECT substring(url,'/[^/]+/[^/]+$') FROM url_time;
Suppose I give input as Input : http://stackoverflow.com/questions/ask then I wish to get Output : /questions
Sorry if it is a trivial question . I have not been able to get to the required solution.
Any help is appreciated.