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 3787710
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:53:01+00:00 2026-05-19T11:53:01+00:00

If I join two tables in a query that looks: SELECT m1.id AS reg,

  • 0

If I join two tables in a query that looks:

SELECT m1.id AS reg, m1.name AS name, f.registered AS status 
FROM phone f 
INNER JOIN members m1 ON m1.id=f.user_id 
WHERE m1.status='1' AND f.registered='1'

And then I want to add another 10 user ID’s in a array like m1.id IN (014,01284,014829,075090) that should also be listed in the result of a query. I want to avoid a third table in the query because I already know users from this table that I need.

The point is that the end result contains all the detail’s of users get from the members table by ID’s listed in phone table and array.

What the best way to do this?

  • 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-19T11:53:02+00:00Added an answer on May 19, 2026 at 11:53 am

    Seems a bit trivial, so maybe not what you need, but like this?

    SELECT m1.id AS reg, m1.name AS name, f.registered AS status 
    FROM phone f 
    INNER JOIN members m1 ON m1.id=f.user_id 
    WHERE 
     (m1.status='1' AND f.registered='1')
    OR
     (m1.id IN (014,01284,014829,075090) )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used a join query for retrieving value from two tables one is
I have a query which is crossing two tables select count(*) from ingenium.empevt, ingenium.evt
I need to join two tables from different MySQL (PHP) connection strings and different
Actually if i am doing INNER JOIN of two tables then i will get
I'm trying to perform a select query over two tables, one containing, for example,
I'm trying to use natural join to join two tables in mySQL that have
I have two tables that I join on the id-column, they look like: +-------+
What is the correct way to (inner-)join two tables when the On-Clause-Criteria depends on
I am doing a join between two tables and want to select the columns
Ok, I have two tables that I am joining and doing a select on

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.