Search code examples
mysqlsqlstringwhere-clausesql-like

Types of Wildcards in MySql


My query:

Select * From tableName Where columnName Like "[PST]%"

is not giving the expected result.

Why does this wildcard not work in MySql?


Solution

  • Thanks everyone!

    For specific this question, we need to use regexp

    Select * From tableName Where ColumnName Regexp "^[PST]";

    For more detail over Regular Expression i.e Regexp :

    https://www.youtube.com/watch?v=KoltE-JUY0c