CMSchoen Posted November 6, 2020 Share Posted November 6, 2020 Hello! I have a database where values might be things like: Apple A_bumblebee A_chair Aster With underscores as part of the name. I want to pull only the things that start with "A_", but my query thinks the _ is a wildcard. How do I tell it that I actually want that specific character? Thank you in advance! Link to comment Share on other sites More sharing options...
Ingolme Posted November 7, 2020 Share Posted November 7, 2020 From the MySQL reference manual ( https://dev.mysql.com/doc/refman/8.0/en/string-comparison-functions.html#operator_like ) Quote To test for literal instances of a wildcard character, precede it by the escape character. If you do not specify the ESCAPE character, \ is assumed. \% matches one % character. \_ matches one _ character. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now