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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:59:31+00:00 2026-06-06T03:59:31+00:00

I need to make a mySQL query and am not sure what the format

  • 0

I need to make a mySQL query and am not sure what the format should be.

Here is the situation, I have a table with the fields – id, name, type

I would use a query similar to the following to get results from the table:

SELECT * FROM table WHERE type='1'

However, I have a list of ID’s from another query. These are items that should be excluded from the results.

I’m sure the answer is simple, but I don’t know enough about mySQL queries to find the answer.

  • 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-06-06T03:59:32+00:00Added an answer on June 6, 2026 at 3:59 am

    A simple NOT IN will be what you want 🙂 It lets you send a list of values and makes sure that its not in them 🙂

    SELECT * FROM table WHERE ID NOT IN (1,2,3)
    

    You could also do it with a subquery with something like:

    SELECT id FROM table WHERE ID NOT IN (SELECT id FROM table2 WHERE type = 1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I make a mysql dump for table from a query? I need
I need to make a synonym search function, using MySQL. Here is the tables
How can i make mysql start every time the system boot ? I need
I need to make custom text field which will format numeric values according to
I have a database mysql and it contains 1000 records of people (Name, Age,
I need to write a validation to make sure that new records created in
I have never had a need to do a random SELECT on a MySQL
I need to make a query in a WordPress plugin but I couldn't find
Not sure how to name correctly this question so feel free to edit if
In a mysql database I have table of geographical areas where each row has

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.