Updating one table with conditions from three other tables

Discussion in 'MySQL' started by nikpony, Sep 23, 2012.

  1. #1
    Hello to all,
    i am trying to create a command for updating one table field but it depends to multiple conditions and i don't know if it is needing the INNER JOIN or double(or more) WHERE condition.
    I will try to explain you now my issue writing down the script that i am trying to create.

    UPDATE jos_jomres_propertys
    SET published = 1
    WHERE jos_jomres_propertys.propertys_uid = jos_jomres_managers_propertys_xref.property_uid
    AND
    WHERE jos_jomres_managers_propertys_xref.manager_id = jos_osemsc_member.member_id
    AND
    WHERE jos_osemsc_member.status = 1

    As you can see jos_jomres_propertys has the field that i want to be updated.
    Also this table has a field(propertys_uid) that is the same with the property_uid field from the table jos_jomres_managers_propertys_xref.
    Also this table jos_jomres_managers_propertys_xref has a field (manager_id) which is the same with member_id field from jos_osemsc_member table!
    Also this table jos_osemsc_member has the field status which is an also adaptor and if it is equal to 1 the process of update will be take place...otherwise not!

    I don't know if this section is the right place for my enquiry but i think that one of you will help me a lot!!!
    Thanks in advance!
     
    nikpony, Sep 23, 2012 IP