I have two tables. I try to select some records from one of them. Then, ID's part of that selection should be used to select some records of the other table. For that, I wrote a statement which takes long time for execution. I even couldn't see the results. Also, that broke my phpmyadmin from localhost.
Here is the code:
SELECT * FROM uniquestructures as uns WHERE uns.ProteinID IN (SELECT unp.* FROM uniqueproteins as unp HAVING LENGTH(unp.PDBASequence) < 20) as T)
To make it clear, first it selects records with all columns which have sequence length less than 20. Later, according to IDs of the selected records, I am searching the records have the same ID (as ProteinID)
Thank you very much for your help