Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL syntax using join(?)
Message
 
 
À
28/03/2004 10:02:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00890101
Message ID:
00892015
Vues:
17
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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform