[thelist] SQL - select in a join?
Canfield, Joel
JCanfield at PacAdvantage.org
Tue Jan 10 10:44:50 CST 2006
What is this doing? I don't get why it's selecting multiple columns as
part of the join. Is it essentially creating a subset of the AGENT_MST
table on the fly, kind of like a view for use in the join?
thanks
joel
------------------------
LEFT JOIN
(
SELECT A.Agent_Id,A.First_Name,A.Last_Name,A.My_Rep_Id,
VALUE
(
AD.Wrk_GROUP_Id,A.Intrl_Wrk_GROUP
) AS Intrl_Wrk_GROUP
FROM AGENT_MST A
LEFT JOIN Agent_Dtl AD ON A.Agent_Id = AD.Agent_Id AND
AD.Eff_Till IS NULL
) A1
ON G.W_Agent_Id = A1.Agent_Id
More information about the thelist
mailing list