ktsirig Posted September 17, 2005 Share Posted September 17, 2005 Hi everybody. I have created a rather complex query for my database, which works OK (I mean it brings the right results). The problem is that the results are brought to me 4 times. That means that if the query has one correct answer, I get the answer, but I get it in 4 times. What can be the fault? I have written my code here, but I don't think it's easier, since it would be difficult to explain the structure of the database SELECT refU.code FROM reference AS refU LEFT JOIN protein_reference AS prU ON refU.reference_id = prU.reference_id LEFT JOIN protein_reference AS prQ ON prU.protein_id = prQ.protein_id LEFT JOIN reference as refQ ON refQ.reference_id = prQ.reference_id LEFT JOIN protein ON protein.protein_id = prU.protein_id LEFT JOIN datab ON datab.datab_id = refU.datab_id LEFT JOIN protein_organism ON protein_organism.protein_id = protein.protein_id LEFT JOIN organism ON organism.organism_id = protein_organism.organism_id LEFT JOIN families_reference ON families_reference.reference_id = refU.reference_id LEFT JOIN families ON families.families_id = protein.families_id WHERE protein.name like '%ahh3%' AND datab.name='prnd'; So, if the correct answer is the code QWE234 for instance, mysql returns: QWE234 QWE234 QWE234 QWE234 I understand that it might be difficult to give me an answer, but I was wondering if there is any mistake in my syntax and therefore I get the result 4 times. The syntax as it is is correct for the job I need it to do. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.