Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL syntax needed
Message
 
 
To
21/11/2008 12:21:41
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01363325
Message ID:
01363529
Views:
15
>>>>>Thank you William.
>>>>>
>>>>BTW, there are other ways to get the same information, but this one is the simplest to remember.
>>>
>>>"Simplest" is very subjective and depends upon how one "grew up" with SQL. I think the pre-VFP9 version
>>>SELECT * FROM Table2 WHERE date IN (SELECT MAX(Date) AS Date FROM Table1)
is simpler to remember. I will accept that the more "modern" code is "better" and may run faster, etc. but simpler, like beauty, is in the eye of the beholder.
>>
>>The code above is not correct.
>>
>>When I was coming home I was thinking I should write a FAQ on this topic since it's a commonly asked question. I thought it through, but I don't think if I can find the time to actually do this.
>
>"The code above is not correct."
>
>How so? I get the same results as Borrislav using the sample data provided. Could you show me conditions where the results will differ?

I meant here, that for date fields you usually don't use IN syntax, you use DATE = (...) Other than that, it's fine.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform