0

I want to select the text after the second (from the left) comma and before the third (from the right) uSing SQL, it's a long text that may contain a comma so I could not split it directly. And I extract the data from an API so I can't change it

A H.
  • 41
  • 5
  • Sigh: storing comma-separated data in an SQL column rarely ends well. This is gonna be painful... there's no shortcut here. You'll have to parse it out by hand using raw string manipulation. If you don't need it further in the query, you're probably better off returning the entire column and parsing in client code. Receiving the data this way from an API is no excuse; in the future, if this is what the API gives you, and a layer to parse these values before inserting and include the fields you need as part of the schema. – Joel Coehoorn Oct 19 '22 at 13:24

0 Answers0