This question already has answers here:
Substring after a space (3 answers)
Closed 21 days ago.
I've seen a few of these questions asked but haven't spotted one that's helped!! I'm trying to select the second part of postcode only.
For example Post_Code
:
'SF87 5NT'
So here I would like my SQL query to only return '5NT'
1条答案
按热度按时间3lxsmp7m1#
Here are a few options:
I personally like the
stuff
approach best when I need to get everything after a certain point. Thesubstring
approach is probably about as good (and more flexible if you need to excise a chunk with stuff after it). The last two, I would not probably recommend, since they're kind of like going around your back to get to your elbow, but they do show some additional ways can manipulate the string.