Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 MySQL 新手,想知道;而不是做
SELECT fields FROM table WHERE name="tim" OR name="bob" OR name="nancy" OR name="john"
如果我能做类似的事情
SELECT fields FROM table WHERE (name="tim" OR "bob" OR "nancy" OR "john")
使用IN子句:
IN
SELECT fields FROM table WHERE name IN ("tim", "bob", "nancy", "john");
你可以这样做 -
SELECT fields FROM table WHERE name in("tim","bob","nancy","john")