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

  • Home
  • SEARCH
  • 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 6700759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:51:12+00:00 2026-05-26T06:51:12+00:00

Tables i have Table1 user_id, date Table2 user_id, status I need something like UPDATE

  • 0

Tables i have
Table1 user_id, date
Table2 user_id, status

I need something like

UPDATE Table2 
   SET status = 2  
   WHERE user_id in ( {SELECT user_id FROM Table1 WHERE date > 0} )

In other words i need to see if date in table1 is more than 0000-00-00 then grab user_id of people who match this criteria and use them in table2 to set their status to 2.
Problem is that i need to do it for more than one user so request inside request does not work for me, it only works when there’s one row in result.

  • 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-26T06:51:12+00:00Added an answer on May 26, 2026 at 6:51 am

    Are you using PHP or some other language to make SQL calls? If so, it might easier to just,

    • firstly: select user ids from table 1
    • secondly: loop through each row
    • thirdly: execute the update

    Regards,
    Mark

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

Sidebar

Related Questions

I have 2 tables, using an inner join to query them. SELECT COUNT(table2.id) FROM
I have Table1 and I need to get it to look like Table2: Table1
I have two tables: Users: ID, first_name, last_name Networks: user_id, friend_id, status I want
I have a couple of tables which look like this Table 1 user_id |
I have two tables like of this structure: content (content_id, content_type, user_id, time, comment_count)
I have three tables set up in a MySQL database called event, status and
I have a table of purchases containing a user_id and a date_of_purchase. I need
Let's say I have a table that has user_id, date, score, and every user
I have 3 tables users(id,name),groups(id,name) and users_groups(user_id,group_id). users and groups have many to many
I have 3 tables: users (id, name) currency (id, name) accounts (id, user_id, currency_id,

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.