We're Moving!

The Vertica Forum is moving to a new OpenText Analytics Database (Vertica) Community.

Join us there to post discussion topics, learn about

product releases, share tips, access the blog, and much more.

Create My New Community Account Now


CHARINDEX vs POSITION(with 3 parameters) — Vertica Forum

CHARINDEX vs POSITION(with 3 parameters)

edited October 2017 in General Discussion

Hello,

I am on the process of converting an ugly SQL string that has lots of CHARINDEX. I understand that the equivalent to CHARINDEX is POSITION, but POSITION only takes 2 parameters. Is there a Vertica function that is similar to CHARINDEX in the sense that it can take 3 parameters? ( expressionToFind , expressionToSearch [ , start_location ] )

As always thank you all for your help

Comments

  • marcothesanemarcothesane - Select Field - Administrator

    You will probably mean:
    SQL>SELECT
    ...> INSTR('Harry''s and Sally''s Bar','''',2,2)
    ...> AS pos_of_second_apo_from_pos_2
    ...>;
    pos_of_second_apo_from_pos_2
    18

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file