38

Apparently `= NULL` is not a thing in mysql, instead you have to use `IS NULL`... Took me a while to figure out why the fuck my query wasn't returning any results.

Comments
  • 6
    Yes, that's the way it's working there.. Doesn't the documentation clearly state that? πŸ˜‰
  • 1
    You will eventually memorize it. Muscle memory. I'm sleepy
  • 2
    A classic πŸ§ πŸ‘ŒπŸΌπŸ‘ˆπŸ» that gets you in the morning at 4 o'clock when the deadline is near...
  • 2
    In a few months youll put “= NULL” again..
  • 0
    @moagggi Yeah it kinda does, but it took me a while to turn to the docs. I figured this made sense and it didn't give an error so I didn't think that would be the problem at first ^^'
  • 2
    kinda makes sense if you think about it. null shouldn't be equal to anything, strictly speaking, so the equality comparison operator doesn't exactly make semantic sense.

    i was stumped by it and disliked it too, but that was a long time ago, now i'm just thinking about it philosophically...
  • 0
    IS NULL is actually the ANSI standard way of doing this, which most databases support. Haven't used a database where you can use = NULL before.
  • 5
    You think that's frustrating, try returning a specific number of specific records in Oracle. TOP 250? Nope. LIMIT 250? Nah. Too easy.

    Here's your ROWNUM and good fucking luck.
Add Comment