General information
Category:
Coding, syntax & commands
Jim,
how can the SELECT know that a function included does not change its value
(it is after all a function call)
and though usually DATE() shouldn't change during the query (btw as Paul
stated what happens if you run the query very close to midnight..)
I don't think it is stupid to re-evaluate them
Arnon
>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
>
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only