MYSQL WHERE-IN Subquery Runs Forever
问题 I have a MySQL table. Let's call it Widgets. The Widget table has 3 fields: id , type_id , and name . I want, in one query, to get all the widgets that share a type_id with the Widget named 'doodad'. I've written 2 queries: Give me the type_id of the widget with the name 'doodad'. Give me all widgets with that type_id. This works. Each query, independently achieves its goal. But when I combine them into a single nested query, it runs forever, infinite loop style. It looks like this: SELECT *