Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting exact record match between datasets
Message
De
08/09/2005 10:48:18
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
08/09/2005 09:11:37
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01047673
Message ID:
01047703
Vues:
6
>In the SQL below, I'm using TransHist.iTransact to determine whether I want a result record or not. What I really need is to know if the exact record does not exist in TransHist, not just by using the iTransact field value. The same fields exist in the crsTestAcctContiUniCont cursor and the TransHist table. How would I do this?
>
>
>
>SELECT * ;
>	FROM crsTestAcctContiUniCont;
>	WHERE crsTestAcctContiUniCont.iTransact NOT IN (SELECT iTransact FROM TransHist) ;
>	INTO CURSOR crsUpdate
>
Jay,
You might do something like this (wouldn't work if data has memo,general):
Select *,1 As _Src From c1 ;
  union ;
  Select *,2 As _Src From c2 ;
  into Cursor CrsU

lcGrpBy = ''
For ix=1 To Fcount()-1
  lcGrpBy = m.lcGrpBy + Iif(Empty(m.lcGrpBy),'',',')+Transform(m.ix)
Endfor

Select * From CrsU ;
  having Sum(_Src) = 1 ;
  group By &lcGrpBy
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform