Jump to content

can't get an extra table included in my query


turpentyne

Recommended Posts

I've got this query, which works fine:

 

SELECT plant_term_id, plant_id, low_id, high_id, plant_measures.unit, measurement_terms.plant_term AS tpart
FROM plant_measures
JOIN measurement_terms ON plant_measures.plant_term_id = measurement_terms.id
WHERE plant_id =134660

 

But I need to get in two extra fields from another table called measurements

 

I want to get the measurements.number field to be included where it matches low_id and where it matches high_id

 

I thought I could just add another join statement, but it doesn't seem to work - I think because the measurement table doesn't have a plant_id. It's just a list of measurements.

 

 

thoughts?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.