So I am on a site at the moment where it has an interactive MySQL Shell prompt.
I was looking up a question that a friend asked which is "why does the query fail when I use the keyword IS
but it works when I use the =
symbol?"
So I tested it out and sure enough it does fail.
SELECT name, continent, population FROM world WHERE continent IS 'Asia'
failed but SELECT name, continent, population FROM world WHERE continent = 'Asia'
works fine.
I have tried googling for an answer but no avail.
Any help would be great!
IS tests against a boolean(True/False/NULL neither) where as = tests equivalency
IS can only be used against variables that return true, false or NULL .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With