Re: Set Complement and Temporary Tables
- From: JohnCreighton_@xxxxxxxxxxx
- Date: 29 Dec 2006 17:37:09 -0800
John Vinson wrote:
On 29 Dec 2006 16:02:38 -0800, JohnCreighton_@xxxxxxxxxxx wrote:
Obviously If I already had a table of
such integers I could do this but that would seem like a waste of
memory.
Disk is cheap. A table with numbers 1 to 10000 takes about 80kbytes
(40 for the table, 40 for the index) plus a little bit of overhead; it
doesn't take ANY memory, except when it's being used. You can have
2,000 kbytes in a .mdb file - a Numbers table is very useful and very
cheap.
John W. Vinson[MVP]
That is a good point. I'll consider that in the future. Anyway I came
up with an alternative way of finding missing numbers:
SELECT summary_index.id, summary_index_1.id
FROM summary_index
LEFT JOIN summary_index As summary_index_1
ON summary_index.id+1=summary_index_1.id
Where ISNULL(summary_index_1.id)
This query finds the start of the interval of missing numbers in the
query or table summary_index. A similar query could be constructed to
find the end point. I would still like to know if there are short hand
ways to generate a sequence or series table incase I need it in the
future.
.
- References:
- Set Complement and Temporary Tables
- From: JohnCreighton_
- Re: Set Complement and Temporary Tables
- From: John Vinson
- Set Complement and Temporary Tables
- Prev by Date: Help -- Is my there any way to not count duplicate values here?
- Next by Date: Re: Calculating Vacation Time
- Previous by thread: Re: Set Complement and Temporary Tables
- Next by thread: Help -- Is my there any way to not count duplicate values here?
- Index(es):
Relevant Pages
|
|