Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Possible in one SELECT command?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01063783
Message ID:
01065226
Vues:
12
Not yet, today i installed the first version and tested it on the net, from different workstations etc...as i told you, the results were excellent.
This Sunday i am testing in the network with the select/replace/select version, i'll tell you how it performs.

Jaime

>>Unbelievable...I just run the "slow" version today on the net, and it run at around 0.5 to 0.9 seconds for most cases although the filters are somewhat slightly different than in my tests ( in the tests i generally use the worst case all the time ).
>>
>
>Have You tried the version in 3 phases: SELECT/REPLACE/SELECT?
>
>>>>Fabio
>>>>1) Why no good? Wrong data result or just too "slow"? ( i tested the result with over 100 lines and the data is correct
>>>
>>>The time. Run you this in local or net file system?
>>>
>>>
>>>
>>>
>>>>2) I understand this code much better than the other one ( in fact now i understand what you did there ). I'll run it too and compare the 2 resulting mytesttable to see if there is any difference.
>>>
>>>You tries the underlying code
>>>(I have extracted the inside query and produced the group's row numbers
>>>with a single replace,
>>>the COUNT(*) it has to make a Cartesian product of the filtered data).
>>>This code doesn't depend on the selectivity of the filter,
>>>and you can organize all the 250000 patients in few seconds.
>>>
>>>
>>>>
>>>>Molto grazzie
>>>>Jaime
>>>>
>>>>>>Bingo!!
>>>>>>This one works perfectly, and in 1.82 seconds by the way.
>>>>>>A million thanks again, Fabio
>>>>>>Jaime
>>>>>>
>>>>>NO GOOD.
>>>>>
>>>>>TRY
>>>>>
>>>>>* phase 1 : grouping info
>>>>>SELECT  ;
>>>>>	DOW(Date)	dateW		;
>>>>>,				Shaa		;
>>>>>,				PCode		;
>>>>>,	Oper		rowGroupNum	;	&& Oper must to be a INTEGER
>>>>>	INTO CURSOR tempPhase1 READWRITE;
>>>>>	FROM Yoman	;
>>>>>	ORDER BY 1,2
>>>>> &&	WHERE Date between m.lStartDate AND m.lStartDate+3 AND  Bit NOT IN ("ì", "ð", "á" )	AND	m.RofeCode IN (  M1,  M2,  M3,  M4 )
>>>>>
>>>>>* this numbers the rows of every group
>>>>>PRIVATE dateW,Shaa
>>>>>DO WHILE NOT EOF()
>>>>>	SCATTER FIELDS dateW,Shaa MEMVAR
>>>>>	REPLACE WHILE dateW=m.dateW AND CTime==m.Shaa rowGroupNum WITH _TALLY
>>>>>ENDDO
>>>>>RELEASE dateW,Shaa
>>>>>
>>>>>* final group transposition
>>>>>SELECT T.Shaa	;
>>>>>,  MAX( IIF(dateW=1, Patient.Shem+Sug+left(NVL(SugTip.SugTipul,"  "),2) ,SPACE(28))) AS Sunday ;
>>>>>,  MAX( IIF(dateW=2, Patient.Shem+Sug+left(NVL(SugTip.SugTipul,"  "),2) ,SPACE(28))) AS Monday;
>>>>>,  MAX( IIF(dateW=3, Patient.Shem+Sug+left(NVL(SugTip.SugTipul,"  "),2) ,SPACE(28))) AS Tuesday ;
>>>>>,  MAX( IIF(dateW=4, Patient.Shem+Sug+left(NVL(SugTip.SugTipul,"  "),2) ,SPACE(28))) AS Wednesday ;
>>>>>FROM tempPhase1 T;
>>>>>LEFT JOIN Patient ON T.PCode=Patient.Code ;
>>>>>LEFT JOIN Sugtip  ON T.Tipul=SugTip.Code ;
>>>>>GROUP BY Shaa , rowGroupNum ;
>>>>>INTO TABLE mytesttable
>>>>>USE IN tempPhase1
>>>>>
Why do programs stop working correctly as soon as you leave the Fox?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform