Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL syntax using join(?)
Message
 
 
To
28/03/2004 10:02:36
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00890101
Message ID:
00892015
Views:
18
Hi Tom,

I don't use one character table aliases for two reasons:
1. They aeke query practicaly unreadable. It's the same as using work area aliase A-J in SELECT < alias > command in VFP procedural code.
2. In VFP I never sure if alias A-J refer to the table alias or the work area with the same name. It could introduce bugs hard to track.

I've to disagree with David on always using table names. In complex and lond query using proper table aliases make it more readable.

>Sergey, could not there be real trouble with using an alias of 'A' - 'J' as VFP uses those aliases for the first 10 open work areas? I know that you advised against the use of a single character alias (which I totally agree with) but have seen others use something like 'A'. Seems like they are asking for trouble with that approach.
>
>>Hi David,
>>
>>There're a few reasons to use a table alias in a query. It's required if you use the same table more than once in a query. It could be a correlated subquery (like below) or a query that uses self-join on a table. You don't have to but may use an alias in multi-table query or/and query with long table names so query will be shorter and more readable. The key is to use short but easy recognizable aliases, not a, b, c, e.t.c.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform