I have three table review_form_languages, review_form_translations and rate_params.
rate_params-> id, labelreview_form_languages-> id, namereview_form_translations-> id, rate_params_id, review_form_languages_id, text
On table rate_params, I would like to get the associated review_form_translations.text linked by rate_params_id for that specific review_form_languages_id.
Would anyone kindly assist?
Advertisement
Answer
You seem to be looking for a simple JOIN. AFAIK, only two tables are involved :
SELECT rp.*, rft.text FROM rate_params rp INNER JOIN review_form_translations rft ON rft.rate_params_id = rp.id WHERE rft.review_form_languages_id = ?
You may replace the ? with the language id whose text you want to retrieve.