>I get a "SQL: Order By clause is invalid" error when USEing the following view:
>
>
>select distinct(CATEGORY) as CATEGORY, DESCRIPT from MYTABLE
> where !empty( CATEGORY ) order by CATEGORY
>
>
>I presume that this is a change of rule in VFP 9, similar to how they change the Group By syntax.
>
>So I think I need to change the DESCRIPT to MIN(DESCRIPT) or MAX(DESCRIPT) and all should work. Right?
>
>But the problem I am having is when I try to change this view in the SDT, I get Error 1808: Order By Clause is Invalid.
>
>Therefore, my question is, how do I change the view in SDT? I have been working with SDT for such a long time I forgot how to change the view any other way.
>
>Thank you in advance for any suggestions.
Hi Dmitry,
Remove parenthesis around CATEGORY in the SELECT list, it makes the column reference to be treated as an expression. Note that ORDER BY first looks for columns in tables and only then for columns with alias in result. It finds CATEGORY in MYTABLE. DISTINCT requires this column to be in SELECT list, but query processor fails to find it because it is "wrapped" as an expression. We will consider to fix this issue.
Thanks,
Aleksey.