Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> WANTED: SQL-Statement
Hi everbody!
I am looking for a solution to the following problem:
I have a table with my numbers, e.g.:
SELECT * FROM MYNUMBERS;
1
3
4
In another table I have all allowed values:
SELECT * FROM ALLNUMBERS;
1
2
3
4
5
The select statement
SELECT * FROM ALLNUMBERS MINUS SELECT * FROM MYNUMBERS;
2
5
returns the set of all the allowed numbers I don't use in MYNUMBERS. Does anybody see a way to get the same result without using the table ALLNUMBERS? (because I would need an ugly table consisting of 10000000 numbers; I am thinking of a statement like: SELECT * FROM "virtual set of numbers from 1 to 5" MINUS SELECT * FROM MYNUMBERS;)
Thank you for any hint!
Frank
frank.dugrillon_at_chbs.mhs.ciba.com
Received on Thu Apr 17 1997 - 00:00:00 CDT