• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Simple SQL, what am I doing wrong!!??

Al Neri

Diamond Member
I have a table

Table Name:Name
NameID...Name
1.............John
2.............Mike
3.............Bill

Table Name:Color
ColorID...Color
1.............Red
2.............Blue
3.............Green

Table Name:Match
NameID...ColorID
1..............2
2..............3
3..............1

I want it to ouput:

John Blue
Mike Green
Bill Red

I tried... which didnt work

Select Name, Color from Name, Color, Match where Name.NameID=Match.NameID AND Color.ColorID=Match.ColorID which outputs what looks like all possible combinations....

What am I doing wrong?

What is this process called?
 
Just created these tables real quick in MySQL and used your query and got the expected results. Not sure what you are doing wrong. Which database engine are you using?
 
Back
Top