Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there any difference?
Message
De
02/09/1997 19:17:52
 
 
À
02/09/1997 19:08:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00048114
Message ID:
00048151
Vues:
26
Because the value returned by a function can change in time or based on any kind of factors! What do you expect to be the result of

SELECT *, date() AS f_date, time() AS f_time FROM bla,bla... ?

I expect to have the exact moment when the record was created in the result. Is this "awfully stupid"?

This is just one reason to evaluate ANY function for each record. Which would be the reason to take only the start value of the DATE() function?

Vlad

>George,
>
>Pardon my English, but that would be awfully stupid of SQL - to run the Date function for every record in the input. What makes you so sure it would do so??
>
>Enquiring minds need to know.
>
>regards,
>Jim N
>
>>>Is there any optimization difference in the following:
>>>
>>>SELECT FIELD FROM TABLE WHERE FIELDDATE=DATE() INTO CURSOR TEMP
>>>
>>>OR
>>>
>>>ldDate=DATE()
>>>SELECT FIELD FROM TABLE WHERE FIELDDATE=ldDate INTO CURSOR TEMP
>>
>>Michel,
>>
>>I'm not sure about differences in optimization, but the latter query should execute faster. The reason being that the date function will have to be called and it will have to return its value for every record in the table. In the latter case, it simply a straight comparison.
>>
>>George
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform