Prodjex Posted August 14, 2017 Share Posted August 14, 2017 I have a column within my MySQL table that holds city and states for records. The dataset looks like the following: Clay County, AL Cleburne County, AL Coffee County, AL Colbert County, AL Conecuh County, AL Coosa County, AL Covington County, AL I need to just select the state name for all of the records. Since I know this is not user input and the data is all clean/structured as above I can trim off what I don’t need with the following command: select right(trim(cityStateField), 2); This then returns the needed results with just the state abbreviation: AL AL AL AL AL AL AL The post MySQL Trim appeared first on Kansas City Web Consulting | Kansas City Web Development. View the full article Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.