4 ms·
Some of these are just silly. E.g. WHERE column IN ('1, 2, 3') How can this ever be expected to work, unless, of course your column is literally '1, 2, 3'?
by d_r 16y ago
Some of these are just silly. E.g.
WHERE column IN ('1, 2, 3')
How can this ever be expected to work, unless, of course your column is literally '1, 2, 3'? Seems strange to blame MySQL for it. ("MySQL is buggy because it cannot infer meaning from my arbitrary string literals!")
- quassnoi 16y agoThis is very often "expected to work". Just search StackOverflow for FIND_IN_SET. Here are just three random hits: http://stackoverflow.com/questions/4037145/mysql-how-to-select-rows-where-value-is-in-array http://stackoverflow.com/questions/4037145/mysql-how-to-sele... http://stackoverflow.com/questions/3946831/mysql-where-problem http://stackoverflow.com/questions/3946831/mysql-where-probl... http://stackoverflow.com/questions/3734161/mysql-select-where-a-in-field http://stackoverflow.com/questions/3734161/mysql-select-wher... None actually "blames" MySQL for that. The article just describes what comes to the beginning developer's mind first, and tells the correct way to do that.