Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement How To?
Message
De
27/02/2006 10:50:43
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01099289
Message ID:
01099464
Vues:
10
Jeff didn't really define "last". Although invoice numbers generally fall in some sort of order I wouldn't depend on that, but rather depend on the date. Something like:
Select CustomerNumber, InvoiceDate, OtherStuff ;
From lcCursor a1;
Where a1.InvoiceDate In ;
  (Select Max(b1.InvoiceDate);
  From lcCursor b1 ;
  Where B1.CustomerNumber = A1.CustomerNumber);
Into Cursor C_NewResultSingleInvoice
>select a1.*;
>   from lcCursor a1;
>   where a1.InvNo IN ;
>       ( select Max( b1.Invno );
>            from lcCursor b1 );
>   into cursor C_NewResultSingleInvoice
>>I need to list the last items purchased by customer.
>>SELECT INVNO,;
>>       ....
>>       INVDTE,;
>>       FROM (lcDirectory + 'ARTRAN01') tran1 ;
>>       WHERE currhist = " " ;
>>UNION ALL;
>>.....
>>into cursor lcCursor
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform