MySQL Forums
Forum List  »  Newbie

how do i use update in a select query
Posted by: Razvan Licaret
Date: August 14, 2016 09:53AM

Hi everyone!
I'm looking for some help on how do I update a field in my query to a predifined value!
I have only managed to come as far as to create the SELECT query:

SELECT `mzm8e_jomcl_adverts`.`id` , `mzm8e_jomcl_extrafields_values`.`advertid`
FROM mzm8e_jomcl_adverts, mzm8e_jomcl_extrafields_values WHERE ((`mzm8e_jomcl_adverts`.`id`) = (`mzm8e_jomcl_extrafields_values`.`advertid`)) AND (`mzm8e_jomcl_adverts`.`userid`) =5560 AND (`mzm8e_jomcl_extrafields_values`.`fieldid`) = 5

The above query, correctly displays all the entries in which I need to update the field.
Currently, the value of fieldid 5 is "1" and I need to change that value to "2".
Any help would be highly appreciated!

Many thanks in advance!

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.