Jump to content

irritating error


ktsirig

Recommended Posts

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.