Home > database >  How to extract the xx xx (xx)
How to extract the xx xx (xx)

Time:10-25

How to extract the hongta group yuxi cigarette factories, all content before and after the brackets brackets brackets?

CodePudding user response:

 declare @ s nvarchar (Max) 
The set @ s='hongta group yuxi cigarette factories'
Select substring (@ s, 1, charindex (' (' @ s) - 1) as [left]
, the substring (@ s, charindex (' (' @ s) + 1, charindex (') '@ s) - charindex (' (' @ s) - 1) as the
, the substring (@ s, charindex (') '@ s) + 1, len (@ s)) AS right
/*
Left in the right
Hongta group yuxi cigarette factories
*/

CodePudding user response:

How do you write regular?

CodePudding user response:

Database don't require it to regular, you can go in the application side
Next:.
  • Related