Skip to content
Advertisement

Split a column in SELECT

I’m trying to get all records where I have a column concatenated with a :.

The data stored in table as like this:

I want to get below results by removing :extra from column in query:

I’m not sure what should I do with my above query.

Advertisement

Answer

For SQL Server, you would do:

You can find the columns using:

The original tag on the question was MySQL, where you can use substring_index():

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement