I have a table Called phones contains all members phone numbers each member has unique id and there is another table called posts the posts table has many rows each post has its member id and another cells
I need to collect all members IDs from the posts table depending on the branches cell and delete from phones table where the members ids collected from the posts table
I tried this but it give me error message that mysql server lost the connection
delete from `phones` where `mid` in(select `uid` from `posts` where `branches` = 'contact');
Note: I'm using mysql workbench with my local server
UPDATED
this query also worked after I setup the Preferences below
Go to Edit -> Preferences -> SQL Editor and increase the parameter: DBMS connection read time out (in seconds). For instance: 86400.
Close and reopen MySQL Workbench. Kill your previously query that probably is running and run the query again.
Thanks to @scaisEdge
branches?branches, the entire table will be scanned and depending on the hardware and resources available to MySQL, it may take much longer than DB connection timeout. Have the indexes, your query is correct.