Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Gaps in Check Sequence?
Message
 
 
À
14/11/2003 16:39:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00850077
Message ID:
00850118
Vues:
21
>If I have a series of checks say 1, 2, 3, 4, 6, 7, 8 - how can I write a SQL statement to show that the number FIVE (5) is missing in this sequence?

I don't think you can do it with one select in VFP. Try
SELECT MAX(CheckNumber) FROM mytable INTO ARRAY laMaxCn
CREATE CURSOR crsTemp ( CheckNumber I)
FOR i=1 TO laMaxCn[1]
	INSERT INTO crsTemp VALUES (i)
ENDFOR
SELECT  CheckNumber ;
	FROM crsTemp ;
	WHERE CheckNumber NOT IN ( SELECT CheckNumber FROM mytable ) ;
	INTO CURSOR crsResult
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform