Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Question How To?
Message
 
 
To
04/02/2006 06:35:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01093476
Message ID:
01093688
Views:
28
>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--
Previous
Reply
Map
View

Click here to load this message in the networking platform