i had sucked at sql query i have 2 tables and 2 rows 1 table is user_sets and second is user_profiles i need to update user_sets row base on row of user_profiles table.
i will give an example.
DB structure
table User_sets
row n_color_pack
-------------
table User_profiles
row gander
---------------------
Query:
UPDATE user_sets
SET n_color_pack = 1
FROM user_profiles,
user_sets
WHERE gander = '0';
So as you see, i would like to update User_sets table by setting n_color_pack 1 for everyone who has gender 0.
You will need to
JOINthe tables to achieve this. Something like this should work (untested):Change
s.idandp.iddepending on which column connects the two tables in your case.(Credit to ruakh for pointing out my syntax error)