Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

CHARINDEX vs POSITION(with 3 parameters)

edited October 2017 in General Discussion


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


  • marcothesanemarcothesane Administrator

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

Leave a Comment

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

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.