MySQL Forums
Forum List  »  MySQL & Kubernetes

How to extract all values except the last value in a string separated by comma in sql
Posted by: Muhammad Akhtar
Date: June 15, 2023 09:22AM

I am think of SUBSTRING_INDEX but dont know how to extract all values except the last value in a string separated by comma

e.g :
value is "aaa,bbb,ccc,ddd"
desired result is "aaa,bbb,ccc"

e.g :
value is "a1,b2,c3,d4,e5"
desired result is "a1,b2,c3,d4"

Options: ReplyQuote


Subject
Written By
Posted
How to extract all values except the last value in a string separated by comma in sql
June 15, 2023 09:22AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.