Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Question How To?
Message
 
 
À
04/02/2006 06:35:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01093476
Message ID:
01093688
Vues:
27
>I'm not sure I understand. What are the c1 and c2 values for in your example? Also can the first select statement in each example be modified to include donor name and address information?

You can assign an alias to a table in a query. It can be done for readability and has to be done if you want to use the same table more than once in the query. The table with alias assigned can be referenced in the query by alias only.
SELECT * FROM Contributions c1 
              ^             ^
              |             table alias
              table name
To add a donor info JOIN the query to the Donors table
SELECT *
  FROM Contributions c1 
  JOIN Donors ON c1.cDonors_id = Donors.cId 
  WHERE NOT EXISTS (
              SELECT * FROM Contributions c2
                WHERE c2.cDonors_id = c1.cDonors_id 
                   AND c2.ContributionDate > c1.ContributionDate)
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform