Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do avoid getting multiple occurrences
Message
 
 
À
04/01/2005 20:20:41
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 8 SP1
OS:
Windows XP SP1
Divers
Thread ID:
00974259
Message ID:
00974260
Vues:
11
This message has been marked as the solution to the initial question of the thread.
Hi Jim,

Try
SELECT DISTINCT soshipline.invtid  as Partno
...
>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')
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform