1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[SQL] It is possible to match a character repetition with patindex? How?

Discussão em 'Outras Linguagens' iniciado por Stack, Setembro 25, 2021.

  1. Stack

    Stack Membro Participativo

    My question is similar to this one:

    It is possible to match a character repetition with regex? How?

    but I want to do it in SQL Server 2012 Express (I think).

    I am building string of random letters, but I want to avoid double characters -- no, actually, want to strip out the second of the dupes

    EDIT: e.g.: My code produced the following string:

    QUUCEG


    I want to detect the duplicate U and remove (replace) one of them (with nothing), producing:

    QUCEG


    All this is in SQL Server, which I do know doesn't have a true/full implementation of regex

    Thus, my question:
    It is possible to match (and replace/remove) a character repetition with patindex? How?

    Continue reading...

Compartilhe esta Página