Hi Jenny,
i am kind of confused. I thought the Select is used to select the Table columns. So looking over the optionsID4 column, the options.optionName is next. I don't have a table called options, but optionstable.
Below is the query. When I run it, I get a MySQL error 1146 Table 'mentor.options'doesn't exist. I have the database named mentortest and that doesn't match the error. I will look this error up.
I was trying to find the AS function description, but the 2 books don't describe it. What does that actually mean.
Thx
Mike
SELECT companytable.companyName, companyindextable.optionsID1, companyindextable.optionsID2, companyindextable.optionsID3, companyindextable.optionsID4, options.optionName, options1.optionName, options2.optionName, options3.optionName, options4.optionName
FROM companytable
LEFT JOIN companyindextable ON companytable.companyID=companyindextable.companyID
LEFT JOIN options ON companyindextable.optionsID=options.optionsID
LEFT JOIN options AS options1 ON companyindextable.optionsID1=options1.optionID
LEFT JOIN options AS options2 ON companyindextable.optionsID2=options2.optionID
LEFT JOIN options AS options3 ON companyindextable.optionsID3=options3.optionID
LEFT JOIN options AS options4 ON companyindextable.optionsID4=options4.optionID