At 01:27 PM 5/19/2012, you wrote:
>On 05/19/12 07:47, Ken Dibble wrote:
> > I don't know what you're saying. I just did this in VFP 9 SP 1:
>
>What I'm saying is that there is a bug in the syntax checking.
>SELECT <field list> DISTINCT is not valid syntax.  VFP accepts it where
>it should not.  That's a bug.
>
>It does not accept SELECT <field list> TOP 5.  It should not.  It works
>correctly in that case.

Okay. I tried to Google this and couldn't find anything that indicates that 
this would be a bug.

I understand that people are saying that something like:

SELECT myfield DISTINCT...

or

SELECT myfield TOP 5

should cause the SQL engine to interpret what comes after the field name, 
when not followed by a comma, as a renaming of the field without an 
explicit "AS".

However, DISTINCT and TOP are SQL keywords, as is FROM.

The engine does not choke on:

SELECT myfield FROM...

So why should it choke on any other SQL keyword following the last field in 
a field list?

Furthermore, the engine doesn't necessarily insist on a specified location 
for other clauses, such as INTO CURSOR. The engine is clearly smart enough 
to parse SQL keywords in more than one location.

In the absence of documentation to the contrary, I would think that the 
failure of TOP to work is the bug, not the ability of DISTINCT to work.

Ken Dibble
www.stic-cil.org



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to