Inko Hagoed
Inko Hagoed

Reputation: 79

MySQL query LIKE getting error

I want to search for people whose name start with letter A using LIKE query but I'm getting errors. What query should I type in order to get results based on people whose name start with a particular letter or not with that letter?

Upvotes: 1

Views: 45

Answers (1)

Hurricane Development
Hurricane Development

Reputation: 2464

Get result where name starts with a specific letter

SELECT * FROM table WHERE name LIKE 'A%'

Get result where name DOES NOT start with a specific letter

SELECT * FROM table WHERE name NOT LIKE 'A%'

Upvotes: 3

Related Questions