Using SQL I'd like to return all text before the 3rd forward slash in a column
so
/one/two/three/whatever/testing
would return:
/one/two/three
Any quick and dirty way to do this in SQL (specifically MS T-SQL under MS SQL 2005+) ?
Using SQL I'd like to return all text before the 3rd forward slash in a column
so
/one/two/three/whatever/testing
would return:
/one/two/three
Any quick and dirty way to do this in SQL (specifically MS T-SQL under MS SQL 2005+) ?
Try adding the function
Then reference the function as such...
Check out an article here for a better look :)
Since you said "quick and dirty", I'm assuming that this very quick and very dirty solution won't receive a bunch of down votes. The SQL below uses multiple
SUBSTRING()
functions to find the third slash:You can see a working example here.