The only difference in FP/VFP SQL Query syntax and 'standard' SQL Query syntax is the semi-colon at the end of the line when a command is continued onto another typed line.
You might notice in the first query that the SQL Query line immediately preceeding the FROM line is terminated with only a semi-colon - NOT a comma + semi-colon
As in 'standard' SQL Query syntax the comma is only used to separate query results FIELDS and does not follow the Last
And, in the case of FP/VFP, the semi-colon is added at the line end to indicate a line continuation.
So where your new code went wrong was in terminating that line immediately preceeding the FROM line (the Last query results field
) with a comma + semi-colon, instead of just the semi-colon.
So your problems here have had much less to do with the Foxpro/Visual Foxpro language than they did with your needing to use 'standard' SQL Query syntax.
If you had followed the rules of 'standard' SQL Query syntax you would have had 99% of this correct.
SELECT resovkvot as resovkvot;
INTO TABLE resovkvot.tmp
Notice the lack of a comma following the Last
query results Field which immediately preceeds the FROM line - as in 'standard' SQL Query syntax.