1

I'm using a query such as

SELECT * FROM tablename WHERE token LIKE 'v_%'

This is resulting in records whose token starts with v_ (which is exactly what I want) but it is also showing records which start with just v (screenshot attached)

enter image description here

Why is this happening? Am I missing something?

1 Answer 1

4

you need to _ because it is a wildcard

SELECT * FROM tablename WHERE token LIKE 'v\_%'

or

SELECT * FROM tablename WHERE token LIKE 'v|_%' ESCAPE '|';
Sign up to request clarification or add additional context in comments.

1 Comment

Nice. +1 and accepting as answer. Got to learn a new thing today.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.