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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:24:13+00:00 2026-05-29T09:24:13+00:00

Because apparently everyone hates sub selects, I would like to do this using joins.

  • 0

Because apparently everyone hates sub selects, I would like to do this using joins.

For an incredibly contrived example, take two tables, one with a list of numbers from 1-6 and one with a list of even numbers from 0-8. Then, my goal would be to output all odd numbers in the table Nums.

Table Nums
Number
One
Two
Three
Four
Five
Six

Table Even
Number
Zero
Two
Four
Six
Eight

If I just wanted to get the list of even numbers that are in Nums, I’d do…

select nums.number
FROM nums,
     even,
where nums.number = even.number;

But, how can I use these tables to get the list of non-evens in the table Nums? Or, in other words, something like…

select nums.number
from nums
where nums.number not in (select number from even);
  • 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-29T09:24:14+00:00Added an answer on May 29, 2026 at 9:24 am

    SubSELECTs are fine when used appropriately… “someone does not like something” alone is not a good enough reason IMHO.

    There are several options – just 2 as examples:

    SELECT nums.number FROM nums 
    LEFT OUTER JOIN even ON even.number = nums.number 
    WHERE even.number IS NULL
    

    OR

    SELECT nums.number FROM nums
    MINUS
    SELECT even.number FROM even
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apparently (because the documentation doesn't say any word of this), in a .NET Transaction
this code compiles in Linux but not Solaris, because apparently ppoll() is Linux specific
I'm learning xForms, but apparently not well enough because I can't figure out why
I periodically remove the tmp out of session files. Apparently, I mismanage sessions because
Evidently I've never had to delete a directory using win32 sdk before, because its
Because apparently require 'date' doesn't include the method hours or seconds etc: undefined method
Emacs SLIME can't connect to swank, because apparently swank cannot initialize correctly. It says
I have a string like this: Heading Some interesting text here HeadingSome interesting text
I'm clueless as to what's going on with this because I have another app
I'm trying to provide functions in everyone's pocket of nowjs. I'd like to do

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.