Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Controlling sort order of child records
Message
De
07/03/2005 11:41:28
 
 
À
07/03/2005 10:44:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
00993287
Message ID:
00993309
Vues:
15
As well as the SQL Select ... Order By ... solution, if yoiu wanted to index your child table on the parent, pemanently (as in persistant reln.), then your ORDERS table could have a key:
CUST_ID + DTOT( ORDER_DATE)                    && assuming CUST_ID is char, or
STR( CUST_ID, n_sig_figs) + DTOT( ORDER_DATE)  && If CUST_ID numeric
HTH

Terry

>Is there a way to control the sort order of the child records in a relationship or a SQL SELECT statement? This seems rather basic but not very easy unless I'm missing something. Say you have a CUSTOMERS table and an ORDERS table. You do a SQL SELECT and you want the orders to appear by date. The orders table must be indexed on customer ID for the relation to work which seems to prevent the date sort. Any attempt to order by date breaks the relation.
>
>There must be a way to do this.
>Help please.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform