Jump to content

mysql query multiplies the results problem


dsp77

Recommended Posts

i have the following query:

SELECT d.domainName, 
a21.*,
a22.*
FROM users AS u
LEFT JOIN a2crit1 AS a21 ON u.id=a21.id_inst
LEFT JOIN a2crit2 AS a22 ON u.id=a22.id_inst
LEFT JOIN domenii AS d ON d.id=a21.id_domeniu
WHERE u.id=20

MySQL client version: 5.0.90

It should result 19 rows but the result is 361 witch is 19x19. Any advice how to repair this?

thanks

 

[users]---------------[a2crit1]-----------------[a2crit2]------------------[domains]

  -id-                    -id_user-                    -id_user-                            -id-

-name-                -id_domain-              -id_domain-                -domain_name-

                          -a21Val1...n-              -a22Val1...n-

 

the result i want to export should have the name fields like:

[name] [domain_name] [a21Val1]....[a21Valn]  [a22Val1]....[a22Valn] 

 

hope this helps

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.