hello to all
I have a table with an autonumber PK (K_ID) and 10 integer fields (K9, K8, K7....K0).
Here are typical records.[tt]
K_ID K9 K8 K7 K6 K5 K4 K3 K2 K1 K0
...
1087645 53 38 38 38 38 38 35 22 14 14
1087646 53 38 38 38 38 35 35 22 14 14
1087647 53 44 38 38 35 35 35 35 35 35
... etc [/tt]
In each record, each value (K9 to K0) is greater or equal to the value to its right.
I am trying to figure out the SQL to delete those records that have MORE THAN 4 identical values. In the example shown, the top row should be deleted (because it has five 38s), and the bottom row should be deleted (because it has six 35s).
I can do this in VBA, I think, but I'm looking for an SQL solution. The tables are HUGE, and I suspect the SQL solution will be much quicker.
thanks in advance for any assistance
Vicky C.
I have a table with an autonumber PK (K_ID) and 10 integer fields (K9, K8, K7....K0).
Here are typical records.[tt]
K_ID K9 K8 K7 K6 K5 K4 K3 K2 K1 K0
...
1087645 53 38 38 38 38 38 35 22 14 14
1087646 53 38 38 38 38 35 35 22 14 14
1087647 53 44 38 38 35 35 35 35 35 35
... etc [/tt]
In each record, each value (K9 to K0) is greater or equal to the value to its right.
I am trying to figure out the SQL to delete those records that have MORE THAN 4 identical values. In the example shown, the top row should be deleted (because it has five 38s), and the bottom row should be deleted (because it has six 35s).
I can do this in VBA, I think, but I'm looking for an SQL solution. The tables are HUGE, and I suspect the SQL solution will be much quicker.
thanks in advance for any assistance
Vicky C.