Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 (INNER) JOIN usage

Author  Topic 

fumpr
Starting Member

5 Posts

Posted - 2010-02-22 : 13:06:37
I need to INNER JOIN 3 Tables...

I need the value of the fields lengte en gewicht

http://i192.photobucket.com/albums/z191/Freekos007/sql1copy.png

http://i192.photobucket.com/albums/z191/Freekos007/sql2.png

http://i192.photobucket.com/albums/z191/Freekos007/sql3.png


I do :
SELECT NUFV.value FROM nuke_users_field_values nufv
INNER JOIN nuke_users on
nuke_users.user-id = nuke_users_field_values.uid
AND INNER JOIN
nuke_users_field_values ON
nuke_users_fields.fid = nuke_users_field_values.fid
WHERE username = 'fumpr'

But it doesn't work

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-02-22 : 13:14:49
I can't access those sites as they are blocked from my network...but I see only 2 tables (nuke_users_field_values table joined twice) in your query
Also..remove the 'AND' befor the 'INNER JOIN'..thats not needed.
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-02-22 : 13:15:39
Why are you using "AND" for the second inner join?It will give you a syntax error.


PBUH
Go to Top of Page

Sachin.Nand

2937 Posts

Posted - 2010-02-22 : 13:17:03
=

PBUH
Go to Top of Page

fumpr
Starting Member

5 Posts

Posted - 2010-02-22 : 14:22:05
oke correction;

SELECT NUFV.value FROM nuke_users_field_values nufv
INNER JOIN nuke_users on
nuke_users.user_id = nuke_users_field_values.uid
INNER JOIN
nuke_users_field_values ON
nuke_users_fields.fid = nuke_users_field_values.fid
WHERE username = 'fumpr'


still an error:
Unknown column 'nuke_users_field_values.uid' in 'on clause'

don't get it, the column does exist?
Go to Top of Page
   

- Advertisement -