I asked this question last week on SO-
It looks like my criteria has changed so I will reask using my current info:
Is it possible in a single SQL statement to do the following:
Use a subset of telephone numbers in an IN statement, for example IN(8001231000,8001231001,8001231002). Then query my database that has phone numbers in it, and return which phone numbers in the original subset of my IN statement are NOT in my database? My db is Oracle 10g.
Basically instead of bringing back which phone numbers ARE IN(8001231000,8001231001,8001231002), I want to know which phone numbers IN(8001231000,8001231001,8001231002) are NOT in my database.
I’m thinking I need to create a temporary table kind of like the answer from my previous question:
SELECT level - 1 + 8001231000
FROM dual
CONNECT BY level <= 8001239999-8001231000+1
But instead of doing a range of numbers, I need to perform a query that can be built using an IN statement. The user will be inputting their telephone number list directly into the IN statement instead of selecting a static range of numbers.
How would I build this in a single statement so I could join and exclude my database result from this list so it would only return the telephone numbers NOT found in my database? Can I do a LEVEL CONNECT BY on a list instead of a range?
This will generate a table (replacing &x with your IN statement) that can be queried against.