Re: col name is not unique & must be qualified by Rush
Rush
Sun May 04 10:26:57 CDT 2008
Anders Altberg wrote:
> "Rush Strong" <rpstrong@gmail.com> wrote in message
> news:yV%Sj.869$ch1.479@trndny09...
>
>> Lew wrote:
>>
>>>> How can a cursor not have an alias?
>>>> Try SELECT 0 before doing the SQL
>>>>
>>>>
>>> ... local alias as in
>>> from mytable a, anothertable b && 'a' & 'b' are local aliases
>>>
>>> the column in question *always* appears as
>>>
>>> a.columninquestion && 'a' being the local alias & thus it is fully
>>> qualified.
>>>
>>>
>> Using 'a' as an alias can be ambiguous, as it can refer to the table in
>> work area 1.
>>
>> - Rush
>>
>
> If the column can't be found in Mytable A, say because of a missing letter,
> then and only then, will VFP try workarea A.
> Letters can be missing because the table has been FRREd from a database and
> the column names have been truncated to 10 letters.
> -Ander
Or if you simply forget to add the alias - that is;
SELECT 1
USE AnotherTable
SELECT 2
USE MyTable
SELECT A.Field1, B.Field2 FROM MyTable, AnotherTable B
If Field1 exists in AnotherTable, it will be used instead of MyTable.Field1.
- Rush