select plantcode, plantname 
from `plant` 
where plantname like 'a%a' or 'm%m';
after I execute the query, it gets only the names that start and end with a from my database, while I also asked for words that also start and end with m!
select plantcode, plantname 
from `plant` 
where plantname like 'a%a' or 'm%m';
after I execute the query, it gets only the names that start and end with a from my database, while I also asked for words that also start and end with m!
 
    
    That's just a wrong syntax - having or m%m in the end without a matching column won't yield the expected result. You have to repeat that plantname:
select plantcode, plantname 
from `plant` 
where plantname like 'a%a' or plantname like 'm%m';
