Skip to content
Advertisement

How to Get only number from string mysql

I have a column called Equipment in my table that contains something like this: store(2)

I need to create a new column and select only the number from the text otherwise we put 1.

Example:

Thanks.

Advertisement

Answer

You can use the REGEXP_SUBSTR function for this.

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