>>>hello,
>>>
>>>I have say 7 .... 20 result tables from which i have to narrow down a list of probables which exists in most of the tables . i.e. say more 7 tables have a value in 10 tables then that value must be included in the final output.
>>>
>>>How should i do it ?
>>>
>>>TIA
>>>suhashegde
>>
>>Hi Suhas,
>>
>>Create table TestProbables (MyNumber I, TableI I)
>>for i=1 to N
>> append from ("table"+transform(m.i))
>> replace TableID with m.i for empty(TableID)
>>next
>>
>>select count(TableID) as Occurrences, MyNumber from TestProbables ;
>> group by MyNumber having Occurrences >= MAXNUMBER into cursor PossibleCandidates
>>
>>** There could be a case with the same number in one table, what do we want to do in such case?
>
>Hi Nadya,
>
>U mean same value more than once in the same table..? No there will not be a chance of that. Good code. I couldnt have thought that way.
>Will try it out
>thanx
>suhashegde
Hi Suhas,
I do not think, it's a good algorithm, it was just the first idea that popped into my head. It would not work if the tables are huge. I'm trying to think of a better algorithm, involving less operations. I hope that some other UT members will jump into this thread with brighter ideas.
If it's not broken, fix it until it is.
My Blog