Performing Inner Join for Multiple Columns in the Same Table?

This seems like the way to go: SELECT A. Answer_id ,C1. Color_name AS favorite_color_name ,C2.

Color_name AS least_favorite_color_name ,C3. Color_name AS color_im_allergic_to_name FROM tbAnswers A INNER JOIN tbColors C1 ON A. Favorite_color = C1.

Color_code INNER JOIN tbColors C2 ON A. Least_favorite_color = C2. Color_code INNER JOIN tbColors C3 ON A.

Color_im_allergic_to = C3. Color_code Rather than "stupid", I'd venture that this is a pretty standard query. This also presumes that all columns will have a valid value.

Otherwise, replace all INNER JOINs with LEFT JOINs.

Thanks, this scenario was hard to google for some reason. – Frankie Simon May 9 '10 at 18:39.

Let's say I have a survey about colors, and I have one table for the color data, and another for people's answers. For display I want to write a SELECT that presents the answers table but using the color_name column from tbColors. I understand the "most stupid" way to do it: naming tbColors three times in the FROM section, using a different alias for each column to replace.

How would a non-stupid way look?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions