Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excluding almost duplicates from a UNION
Message
De
28/06/2001 12:09:16
Evans Carl
System Answers Consulting, Inc
Big Lake, Minnesota, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00524751
Message ID:
00524773
Vues:
19
This message has been marked as the solution to the initial question of the thread.
>Ok, is seems like I knew how to do this, but for some reason, I'm just not making the right connections this morning. :) I have this union:
>
>
>SELECT purno, potype, purdate, currid, postat, puramt, recamt, vendno, company, "C" AS chfile ;
>  FROM a_pomast ;
>  INTO CURSOR ac_pomast ;
>UNION ;
>SELECT purno, potype, purdate, currid, postat, puramt, recamt, vendno, company, "H" AS chfile ;
>  FROM a_poymst
>
>
>There are some records that are in both tables. Normally, they would be filtered out as duplicates. But because I added that extra field to tell me which table they came from, they're showing up as unique. How do I tell it to filter duplicates based just on the purno?
>
>Thanks,
>
>Michelle

You may want to try using where clause like
WHERE a_pomast.purno is not in (SELECT purno, potype, purdate, currid, postat, puramt, recamt, vendno, company, "H" AS chfile) - normally SBT has a field that with current mark(X) to let you know that the record is have been moved to history.

Carl
¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø¤º°¤º°`°º¤ø¤º°¤º°
Carl Evans
CEO & President
System Answers Consulting, Inc.
MCSD .NET, ASP.NET, C#.NET, VB.NET,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform