rony_78 Posted August 26, 2013 Share Posted August 26, 2013 I have a table with column1 and column2. How do i write a query to search in column1 for last two matching words and write '1' and '2' in column3. All datas in col1 contains last two word either ab or cd. Help me to get started . Link to comment Share on other sites More sharing options...
justsomeguy Posted August 27, 2013 Share Posted August 27, 2013 That's a pretty vague description. If you're using MySQL, it looks like you can use substring_index to get the end of the string after the second to last space character, and compare from there: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substring-index Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now