Posted By

ironcrema on 11/12/13


Tagged

sql server substring CHARINDEX


Versions (?)

Extraer cadena segun caracter


 / Published in: SQL
 

Extrae subcadena de cadena separado por caracter

  1. SELECT
  2. CASE
  3. WHEN CHARINDEX('(', Val) > 0 THEN
  4. RTRIM(SUBSTRING(val,1, CHARINDEX('(', Val) - 1))
  5. ELSE Val
  6. END
  7. FROM @DATA

Report this snippet  

You need to login to post a comment.