|
Is there a way to trim all the characters before it hits a special character. For example the table has data such as "\SERVER01\printer01". I do not want to display \SERVER01\ The output i want is printer01 Please help!
(comments are locked)
|
select col,right(col,locate('\',reverse(col))-1) from your_table
What did you change? Added code tag?
Nov 09 '09 at 10:34 AM
Madhivanan
Yeah, I put tags around your code as I thought the automatic colour coding (which you get if you use 4-space-indentation) looked a bit naff, hope you don't mind?. (In case you are not aware: if you click on the "Edited 22 hours ago" thingie by my name you'll normally see the change in the history list - it doesn't show the PRE tag though
Nov 10 '09 at 07:55 AM
Kristen ♦
Thanks for the comment
Nov 10 '09 at 09:31 AM
Madhivanan
Why does comment require minimum 15 characters?
Nov 10 '09 at 09:34 AM
Madhivanan
Stop comments with just YES / NO perhaps?
Nov 10 '09 at 06:47 PM
Kristen ♦
(comments are locked)
|
|
SELECT PARSENAME(REPLACE(Col1, '\', '.'), 1) FROM Table1 I don't think PARSENAME is available MySQL ?
Nov 10 '09 at 07:57 AM
Kristen ♦
Yes not supported in mysql
Nov 10 '09 at 09:34 AM
Madhivanan
(comments are locked)
|


Please note that thisforum is specifically for Microsoft SQL Server, so the folk here may not have good knowledge of MySQL