Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
(natural?) join question
Using VFP 5.0a on WinNT 4.0 sp3.
I want to do a select statement on two (or possibly more) tables where the results are based on an equal condition of a field from each table.
If I do a "select * from a, b where a.id = b.id" I will get the desired result except that I'll get two fields named a.id_a and b.id_b, but no field named a.id or b.id.
One way to do this would be to list all the desired fields in the output, but this list is very long and there is a limit (I think the list is limited by number of chacters), it is prone to errors, and just plain nasty looking.
I think that what I am describing is a natural join, but I am not finding anything on natural join or the reference to the SELECT - SQL command.
I do not care if I get a field named something like a.id_X or b.id_X, but I would like to guarantee a field named a.id (or tablename.id). Is there an easy way to do this?
TIA,
Marc Mandel
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement