I would like to clarify one small nuance that I constantly encounter in my practice. For example. To get a list of all enterprises in Moscow, we make a request:
SELECT `company` FROM `table_1` WHERE `city`='MOSCOW'
But what should the query look like if we want to get a list of all enterprises in any city except Moscow? I have two options:
SELECT `company` FROM `table_1` WHERE `city`!='MOSCOW' SELECT `company` FROM `table_1` WHERE NOT `city` IN ('MOSCOW')
What do literate programmers think about this? What should be the record?
EXPLAIN SELECT company FROM table_1 WHERE city!='MOSCOW'
andEXPLAIN SELECT company FROM table_1 WHERE NOT city IN ('MOSCOW')
tells us - ArchDemon