Query JOIN help? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Query JOIN help?

For each record in table A, I want to return the entire contents of
table B. What is the most efficient way to accomplish this?
Here are my table definitions with a few records of data:
TABLEA
firstName | color
——————-
Person1, blue
Person1, green
Person2, blue
TABLEB
color
——–
blue
green
red
If the color matches a color in tableB, I want to return the color,
otherwise return a null.
I want to return results Like this:
Person1, blue
Person1, green
Person1, ”
Person2, blue
Person2, ”
Person2, ”
You’re looking for a FULL JOIN – look it up in BOL (Books OnLine, installed with the SQL Server software).
]]>