MySQL ASSISTANCE: UPDATE> INNER JOIN> WHERE

Hi, I have a *MYSQL Update* Query where I need to use an *inner join* and * where* but its not working, any assistance will be highly appreciated. UPDATE jos_jreviews_content SET jr_soserviceareapopulation = NULL FROM jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid WHERE jr_soserviceareapopulation =0 Rgds Kibui Kenneth Maina,* * * * *Tel:* +254 (0) 721 173 780 *Blog:* Opticom Solutions<http://opticomsolutions.blogspot.com/> *Website*: kit-b.com <http://www.kit-b.com> *Twitter:* @mainakibui<https://twitter.com/#%21/mainakibui> * * *Tools I Use:* Joomla, PHP, MYSQL, Learning Python, Amazon cloud hosting, WHM, Cpanel, Adobe CS4, Dreamweaver, Cent OS, Linux, Windows, Networking, Hardware, VM Ware.

I'm not a DB guru, but my understanding of joins tells me that you are using more than one table. Are you trying to update *two* tables using one UPDATE statement? On 1 August 2011 09:55, Kibui Maina <mainakibui@gmail.com> wrote:
Hi, I have a *MYSQL Update* Query where I need to use an *inner join* and *where* but its not working, any assistance will be highly appreciated.
UPDATE jos_jreviews_content SET jr_soserviceareapopulation = NULL FROM jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid WHERE jr_soserviceareapopulation =0
Rgds Kibui Kenneth Maina,* *
* * *Tel:* +254 (0) 721 173 780 *Blog:* Opticom Solutions<http://opticomsolutions.blogspot.com/> *Website*: kit-b.com <http://www.kit-b.com> *Twitter:* @mainakibui<https://twitter.com/#%21/mainakibui>
* * *Tools I Use:* Joomla, PHP, MYSQL, Learning Python, Amazon cloud hosting, WHM, Cpanel, Adobe CS4, Dreamweaver, Cent OS, Linux, Windows, Networking, Hardware, VM Ware.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

Kibui, What are you trying to achieve because there are better ways of doing this. In my view you are mixing up stuff and would suggest you do a subquery. Wilson. On Mon, Aug 1, 2011 at 9:55 AM, Kibui Maina <mainakibui@gmail.com> wrote:
Hi, I have a *MYSQL Update* Query where I need to use an *inner join* and *where* but its not working, any assistance will be highly appreciated.
UPDATE jos_jreviews_content SET jr_soserviceareapopulation = NULL FROM jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid WHERE jr_soserviceareapopulation =0
Rgds Kibui Kenneth Maina,* *
* * *Tel:* +254 (0) 721 173 780 *Blog:* Opticom Solutions<http://opticomsolutions.blogspot.com/> *Website*: kit-b.com <http://www.kit-b.com> *Twitter:* @mainakibui<https://twitter.com/#%21/mainakibui>
* * *Tools I Use:* Joomla, PHP, MYSQL, Learning Python, Amazon cloud hosting, WHM, Cpanel, Adobe CS4, Dreamweaver, Cent OS, Linux, Windows, Networking, Hardware, VM Ware.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Kind Regards, Wilson B.

UPDATE jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid SET jr_soserviceareapopulation = NULL WHERE jr_soserviceareapopulation =0 On Mon, Aug 1, 2011 at 10:02 AM, Wilson Bandi <bandson67@gmail.com> wrote:
Kibui,
What are you trying to achieve because there are better ways of doing this. In my view you are mixing up stuff and would suggest you do a subquery.
Wilson.
On Mon, Aug 1, 2011 at 9:55 AM, Kibui Maina <mainakibui@gmail.com> wrote:
Hi, I have a *MYSQL Update* Query where I need to use an *inner join* and *where* but its not working, any assistance will be highly appreciated.
UPDATE jos_jreviews_content SET jr_soserviceareapopulation = NULL FROM jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid WHERE jr_soserviceareapopulation =0
Rgds Kibui Kenneth Maina,* *
* * *Tel:* +254 (0) 721 173 780 *Blog:* Opticom Solutions<http://opticomsolutions.blogspot.com/> *Website*: kit-b.com <http://www.kit-b.com> *Twitter:* @mainakibui<https://twitter.com/#%21/mainakibui>
* * *Tools I Use:* Joomla, PHP, MYSQL, Learning Python, Amazon cloud hosting, WHM, Cpanel, Adobe CS4, Dreamweaver, Cent OS, Linux, Windows, Networking, Hardware, VM Ware.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Kind Regards,
Wilson B.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

.... u could try updating the tables individually. it wld be a short term solution, but at least it will help get u moving to the launch of ur product... which i imagine is more important than getting a perfect solution for that one problem. On 8/1/11, Chris Mwirigi <mwirigic@gmail.com> wrote:
UPDATE jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid SET jr_soserviceareapopulation = NULL WHERE jr_soserviceareapopulation =0
On Mon, Aug 1, 2011 at 10:02 AM, Wilson Bandi <bandson67@gmail.com> wrote:
Kibui,
What are you trying to achieve because there are better ways of doing this. In my view you are mixing up stuff and would suggest you do a subquery.
Wilson.
On Mon, Aug 1, 2011 at 9:55 AM, Kibui Maina <mainakibui@gmail.com> wrote:
Hi, I have a *MYSQL Update* Query where I need to use an *inner join* and *where* but its not working, any assistance will be highly appreciated.
UPDATE jos_jreviews_content SET jr_soserviceareapopulation = NULL FROM jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid WHERE jr_soserviceareapopulation =0
Rgds Kibui Kenneth Maina,* *
* * *Tel:* +254 (0) 721 173 780 *Blog:* Opticom Solutions<http://opticomsolutions.blogspot.com/> *Website*: kit-b.com <http://www.kit-b.com> *Twitter:* @mainakibui<https://twitter.com/#%21/mainakibui>
* * *Tools I Use:* Joomla, PHP, MYSQL, Learning Python, Amazon cloud hosting, WHM, Cpanel, Adobe CS4, Dreamweaver, Cent OS, Linux, Windows, Networking, Hardware, VM Ware.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Kind Regards,
Wilson B.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

@ John Doe Smith Kamau I have thousands of records to update not just one column, getting it to work for one column is just the beginning. Thnks nyway. Rgds Kibui Kenneth Maina,* * * * *Tel:* +254 (0) 721 173 780 *Blog:* Opticom Solutions<http://opticomsolutions.blogspot.com/> *Website*: kit-b.com <http://www.kit-b.com> *Twitter:* @mainakibui<https://twitter.com/#%21/mainakibui> * * *Tools I Use:* Joomla, PHP, MYSQL, Learning Python, Amazon cloud hosting, WHM, Cpanel, Adobe CS4, Dreamweaver, Cent OS, Linux, Windows, Networking, Hardware, VM Ware. On Mon, Aug 1, 2011 at 10:39 AM, John Doe Smith Kamau KipNg'etich Jones < skunkworks.ku@gmail.com> wrote:
.... u could try updating the tables individually. it wld be a short term solution, but at least it will help get u moving to the launch of ur product... which i imagine is more important than getting a perfect solution for that one problem.
On 8/1/11, Chris Mwirigi <mwirigic@gmail.com> wrote:
UPDATE jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid SET jr_soserviceareapopulation = NULL WHERE jr_soserviceareapopulation =0
On Mon, Aug 1, 2011 at 10:02 AM, Wilson Bandi <bandson67@gmail.com> wrote:
Kibui,
What are you trying to achieve because there are better ways of doing this. In my view you are mixing up stuff and would suggest you do a subquery.
Wilson.
On Mon, Aug 1, 2011 at 9:55 AM, Kibui Maina <mainakibui@gmail.com> wrote:
Hi, I have a *MYSQL Update* Query where I need to use an *inner join* and *where* but its not working, any assistance will be highly appreciated.
UPDATE jos_jreviews_content SET jr_soserviceareapopulation = NULL FROM jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid WHERE jr_soserviceareapopulation =0
Rgds Kibui Kenneth Maina,* *
* * *Tel:* +254 (0) 721 173 780 *Blog:* Opticom Solutions<http://opticomsolutions.blogspot.com/> *Website*: kit-b.com <http://www.kit-b.com> *Twitter:* @mainakibui<https://twitter.com/#%21/mainakibui>
* * *Tools I Use:* Joomla, PHP, MYSQL, Learning Python, Amazon cloud hosting, WHM, Cpanel, Adobe CS4, Dreamweaver, Cent OS, Linux, Windows, Networking, Hardware, VM Ware.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Kind Regards,
Wilson B.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke

Thanks @ Chris Mwirigi.... worked like a charm :) Rgds, Kibui Kenneth Maina,* * * * *Tel:* +254 (0) 721 173 780 *Blog:* Opticom Solutions<http://opticomsolutions.blogspot.com/> *Website*: kit-b.com <http://www.kit-b.com> *Twitter:* @mainakibui<https://twitter.com/#%21/mainakibui> * * *Tools I Use:* Joomla, PHP, MYSQL, Learning Python, Amazon cloud hosting, WHM, Cpanel, Adobe CS4, Dreamweaver, Cent OS, Linux, Windows, Networking, Hardware, VM Ware. On Mon, Aug 1, 2011 at 10:22 AM, Chris Mwirigi <mwirigic@gmail.com> wrote:
UPDATE jos_jreviews_content
LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid SET jr_soserviceareapopulation = NULL WHERE jr_soserviceareapopulation =0
On Mon, Aug 1, 2011 at 10:02 AM, Wilson Bandi <bandson67@gmail.com> wrote:
Kibui,
What are you trying to achieve because there are better ways of doing this. In my view you are mixing up stuff and would suggest you do a subquery.
Wilson.
On Mon, Aug 1, 2011 at 9:55 AM, Kibui Maina <mainakibui@gmail.com> wrote:
Hi, I have a *MYSQL Update* Query where I need to use an *inner join*and *where* but its not working, any assistance will be highly appreciated.
UPDATE jos_jreviews_content SET jr_soserviceareapopulation = NULL FROM jos_jreviews_content LEFT JOIN jos_content ON jos_content.asset_id=jos_jreviews_content.contentid WHERE jr_soserviceareapopulation =0
Rgds Kibui Kenneth Maina,* *
* * *Tel:* +254 (0) 721 173 780 *Blog:* Opticom Solutions<http://opticomsolutions.blogspot.com/> *Website*: kit-b.com <http://www.kit-b.com> *Twitter:* @mainakibui<https://twitter.com/#%21/mainakibui>
* * *Tools I Use:* Joomla, PHP, MYSQL, Learning Python, Amazon cloud hosting, WHM, Cpanel, Adobe CS4, Dreamweaver, Cent OS, Linux, Windows, Networking, Hardware, VM Ware.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Kind Regards,
Wilson B.
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
participants (5)
-
Chris Mwirigi
-
John Doe Smith Kamau KipNg'etich Jones
-
Kibui Maina
-
Simon Mbuthia
-
Wilson Bandi