Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7589883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:16:19+00:00 2026-05-30T20:16:19+00:00

i had sucked at sql query i have 2 tables and 2 rows 1

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:16:20+00:00Added an answer on May 30, 2026 at 8:16 pm

    You will need to JOIN the tables to achieve this. Something like this should work (untested):

        UPDATE user_sets as s
        INNER JOIN user_profiles as p
        ON s.id = p.id
        SET s.n_color_pack = 1    
        WHERE p.gander = 0
    

    Change s.id and p.id depending on which column connects the two tables in your case.

    (Credit to ruakh for pointing out my syntax error)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had to delete all the rows from a log table that contained about
Had something weird start happening to me today. I have an asp.net mvc app
Had a quick question about Sphinx Search installation. Do I need to install it
Had anyone any idea how to query a vbulletin database to generate a report
Had a question that I've often wondered about. Is it better to have multiple
Had a quick question.. Googled but nothing worthwhile found.. I have a simple type
Had a look around and couldn't find an answer. I need to add the
I had a question regarding the BASE version in svn. I know it is
I have always sucked at complex arrays there must be something in my brain
Had there been no System.Random class, how would have you generated a random number?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.