Unanswered: Pulling Data Twice From A Reference Table In A Single Record
In the following example, I want to reference the CONDITION table twice in each record to fetch the name of the condition of an item before and after. How could I do that to get the desired result?
bc.condition_name as before_condition,
ac.condition_name as after_condition
FROM item i
JOIN condition bc ON i.before_condition_id = bc.condition_id
JOIN condition ac ON i.after_condition_id = ac.condition_id
Please use [code] tags in the future to make your SQL and sample data more readable.
See the help for details: http://www.dbforums.com/misc.php?do=bbcode