sql server - Find substring and then extract preceding substring -


This morning was beating my head this morning.

  • Required for model 3453535345353453453
  • I need 35435453
  • p> The main word here is "necessary" but I can get that more status but I am having trouble pulling that number which can vary in length. I have tried to differentiate about it and have not received it.
      Select left (sub-string (notes, patindex ('% required' ', notes), 8000), patindex ('% required '', substitution (notes, patindex ('% required % ', Notes), 8000)) + 1) to .... Where ....   

    Can anyone talk to me with the right direction or perhaps code assistance? thank you in advanced.

    OK, it's ugly, but it works:

     < code>; (SELECT * FROM (VALUES (Required 'Model 389448937594'), ('O, model 3453535345353453453 required'), ('I need demand 35435453')) A (string) Selection string, reverse (LEFT (data, CHARINDEX ('', data)) model (reverse selection (LEFT (string, PATINDEX ('% required%', string) -2) data, string from CTE) A   

    The results are as follows:

      one "one" ????? ?????? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? A ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? A ?????? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? A ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? ???? A ???? a ?? a ???? a ???? a ???? a ???? a ???? ???? ???? ???? ???? ???? ???? ??? one one one ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ?? One One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? Line Line Line Line Model 389448937594 is required ??? 38 9 448937594 One ???? a???? Hey, model 3453535345353453453 is needed ??? 3453535345353453453 One ???? a???? I want 35435453 needed. 35435453 a ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ?? © One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ???? One ????    

  • Comments

    Popular posts from this blog

    Verilog Error: output or inout port "Q" must be connected to a structural net expression -

    jasper reports - How to center align barcode using jasperreports and barcode4j -

    c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -