Reputation: 41
I have this string '275,278,222'
How to SELECT only 278, which is in the second position? or SELECT only 222 which is in the third position?
Upvotes: 0
Views: 15
Reputation: 41
second position : SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(STAFFID_, ',', 2),',',-1)
third position : SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(STAFFID_, ',', 3),',',-1)
Upvotes: 1