Search code examples
mysqlsqlsql-like

MySQL Like function only works on some tables


I have two tables within the same database.

On one I can use the MySQL function LIKE to locate a company name. On the other I always get returned zero results, even when I use a simple match like:

SELECT name 
  FROM table 
 WHERE name LIKE 'a%' 

Is there a reason for this? Is there a setting or something that needs to be changed?


Solution

  • You could try seeing if you get anything by simply using

    SELECT name FROM table WHERE name LIKE '%'
    

    Maybe nothing starts with a?