I have some urls in a table like so
http://test.com/abc/ghgh.html
http://test.com/bcd/
http://test.com/fff/default.aspx
http:// test2.com/a
I want to select everything before the last /
but if the last / is after the .com then just get it how it is.
so above should result in
http://test.com/abc
http://test.com/bcd
http://test.com/fff
http:// test2.com/a
create table testing2 (
url varchar2(50)
);
insert into testing2 values ('http://test.com/abc/ghgh.html');
insert into testing2 values ('http://test.com/bcd/');
insert into testing2 values ('http://test.com/fff/default.aspx');
insert into testing2 values ('http:// test2.com/a');