Return only part of the SQL field in the query

Asked

Viewed 131 times

2

I wanted to return in the query only the values that are between parentheses in the table field.

SELECT F2 FROM [dbo].[Vestcasa_Ranking_Produtos_Custo_]


F2
Airtom..(635)
paulo victo r.. (234) 
Antonio.. (459)

SEEK LIKE THIS

635
234
459
  • very broad question, I can not understand what you want.

  • From the content of your search fields you want to return only what is between parentheses is this?

1 answer

2


Testing in this way:

Select
    SUBSTRING(F2,CHARINDEX('(',F2)+1 ,CHARINDEX(')',F2)-CHARINDEX('(',F2)-1)  
from 
    [dbo].[Vestcasa_Ranking_Produtos_Custo_]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.