I would think there's a way to do this... I'm trying to write a query with a few joins and all's working according to plan until the end.
Here's my query:
SELECT r . * , c . * , q.questionnaire_abbr, s.response_completed_on
FROM rr_references r
LEFT JOIN rr_candidates c ON c.candidate_id = r.reference_candidate_id
LEFT JOIN admin a ON a.id = c.candidate_client_id
LEFT JOIN questionnaires q ON q.questionnaire_id = a.questionnaire_id
LEFT JOIN questionnaire_abbr AS s ON s.response_pcode = r.reference_password
WHERE reference_deleted =0
AND reference_candidate_id = '105'
AND reference_client_id = '2959'
ORDER BY reference_first_name ASC
LIMIT 0, 50
The problem here is that the questionnaire_abbr variable that I'm getting in this query is also the name of another database table out there. So I want that last LEFT JOIN to somehow translate into the full value for what q.questionnaire_abbr is.
Is this possible?
Please advise,
Shaun