Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do avoid getting multiple occurrences
Message
De
04/01/2005 20:20:41
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How do avoid getting multiple occurrences
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Divers
Thread ID:
00974259
Message ID:
00974259
Vues:
45
I have a fairly simple SQL statement (below) which is causing me one problem. I'm attempting to retrieve 'soshipheader.custid' (customer id), and there can be multiple matching records in 'soshipheader' based on my criteria (all with the same value for 'custid'), so I end up getting multiple groups of records for everything from 'soshipline'.

All I'm really looking for here is the 'custid' from the FIRST matching record in 'soshipheader'. Is it possible to do that?
 SELECT soshipline.invtid  as Partno
           , soshipline.qtypick
           , soshipline.qtyship
           , soshipline.ordnbr
           , soshipline.siteid
           , soshipline.slsprice
           , soshipheader.custid
      FROM soshipline, soshipheader, inventory
      WHERE inventory.invtid = soshipline.invtid
        AND soshipline.ordnbr = soshipheader.ordnbr
        AND inventory.transtatuscode <> 'in'
        AND soshipline.status = 'O'
        AND soshipline.qtypick <> '0'
        AND soshipheader.status = 'O'
        AND soshipheader.sotypeid not in ('ka','tr')
Thanks
Jim Nelson
Newbury Park, CA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform