Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
An index problem
Message
 
To
02/01/2002 12:28:24
Denis Filer
University of Oxford
United Kingdom
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00599805
Message ID:
00599808
Views:
19
>I have a Table A with a list of plants, each of which has a species name. The species name list is held in Table B. Table A has a numeric code relating to Table B. Table B is indexed on this numeric code to facilitate the relationship. All of this ... the most basic relationship between two tables.
>
>However, I want to list Table A sorted A-Z by species? Clearly, if I switch the Table B index to the species names sorted AZ, the relationship to A is lost. My work around for now is to include a (redundant)short species name field in Table A and to index on this. It works - but can't be the correct way.

Denis,

Use this;
SELECT Tablea.*, TableB.Species ;
  FROM TableA JOIN TableB ;
    ON TableA.SpeciesCode = TableB.SpeciesCode ;
 ORDER BY TableB.Species ;
INTO CURSOR MyPlants
Previous
Reply
Map
View

Click here to load this message in the networking platform