B
banem2
Hello. I have already create a program using test records and it is
working (partially thanks to help I got here).
Using larger set of data it soon hits limit of 2 GB in size.
Basic idea is to use one table and connect each ID with each other
ID's without repeating.
Simplified table is fairly simple:
ID
1
2
3
4
5
From this table I need to have another table created, like:
ID1, ID2
1, 2
2, 5
3, 4
4, 2
5, 1
Appearance of second ID's is random and condition is ID1 <> ID2 (ID1
Not Like ID2).
To make it simple and to have best speed I have solved this by
creating a copy of first table and by creating query with both tables
in without relation. That query produce all possible combinations
(5*5-5 records, that is X*X-X) records and then pick first 5 (that is
X) records and write them in second table. In this case 20 records.
Problem is with "large" amount of records, say with 10.000. Then it
will try to create 10.000*10.000-10.000 records which is too much for
Access. If I change parameter of query from VBA (thanks to advice from
here) to have Top(Count of records in first table) I can have only
10.000 records in temp table, but this query takes equal long time to
run. Fairly said, if I can solve it other way, 10k records is not much
to handle in Access.
Well, I run out of ideas, but I am interested if anyone here had
similar problem?
I will rather use VBA for this, but for some reason client insist on
SQL (queries). Are there any solution to use same table twice in
query, find only first n records with condition ID1 <> ID2 which will
work at acceptable speed?
I will appreciate any ideas. Thanks!
working (partially thanks to help I got here).
Using larger set of data it soon hits limit of 2 GB in size.
Basic idea is to use one table and connect each ID with each other
ID's without repeating.
Simplified table is fairly simple:
ID
1
2
3
4
5
From this table I need to have another table created, like:
ID1, ID2
1, 2
2, 5
3, 4
4, 2
5, 1
Appearance of second ID's is random and condition is ID1 <> ID2 (ID1
Not Like ID2).
To make it simple and to have best speed I have solved this by
creating a copy of first table and by creating query with both tables
in without relation. That query produce all possible combinations
(5*5-5 records, that is X*X-X) records and then pick first 5 (that is
X) records and write them in second table. In this case 20 records.
Problem is with "large" amount of records, say with 10.000. Then it
will try to create 10.000*10.000-10.000 records which is too much for
Access. If I change parameter of query from VBA (thanks to advice from
here) to have Top(Count of records in first table) I can have only
10.000 records in temp table, but this query takes equal long time to
run. Fairly said, if I can solve it other way, 10k records is not much
to handle in Access.
Well, I run out of ideas, but I am interested if anyone here had
similar problem?
I will rather use VBA for this, but for some reason client insist on
SQL (queries). Are there any solution to use same table twice in
query, find only first n records with condition ID1 <> ID2 which will
work at acceptable speed?
I will appreciate any ideas. Thanks!