Sergey,
Thanks. For some reason it never occurred to me that 'tablename.*' syntax was possible - I never tried it. I only knew of 'select *'
>You don't have to list the fields from both tables. You can tell VFP to pull all fields from one table and list the fields you need from another table.
select sosord.*, ;
> sostrs.field1, sostrs.field2, ... sostrs.field1 ;
> from sosord, sostrs ;
> where sosord.csono=sostrs.csono
I agree that it would be nice if we have more control over how VFP names duplicate columns.
>
>
>>In sql server/transact sql when a query such as:
>>
>>select * from sosord, sostrs where sosord.csono=sostrs.csono
>>
>>is executed, the key value appears once in the result set as csono. In vfp you end up with csono_a, and csono_b.
>>
>>If I want my cursor result to be 'clean' and not have the underscores, then I need to explicitly name all the columns, and include the key from only one of the tables, once. But this results in very long query statements. I wrote a little routine to retrieve all of the column names for a given table into a formatted select string, and put it on the clipboard. This helps speed things up, but I still would be able to use select *.
>>
>>Is there any syntax, or trick that I can use to shorten my select statements. E.g. I wish there was a keyword like
>>
>>select * from sosord, sostrs where sosord.csono=sostrs.csono NODUPLICATEKEYVALUES
>>
>>Is there a specific reason why VFP's sql is implemented so differently than TRANSACT-SQL in such a fundamental area?