-1
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!

1 Answers1

1

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';
Nico Haase
  • 11,420
  • 35
  • 43
  • 69