Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL quiz. Statement that returns *missing* values
Message
De
14/07/2011 23:03:58
 
 
À
13/07/2011 03:29:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01518034
Message ID:
01518210
Vues:
71
>To find the start of all the gaps:
>Select k.numfield+1 as manko From yourtable k;
>   Where k.numfield+1 Not in (Select numfield From yourtable)
>
>
>>A table has an index column that starts at one and goes to N, with some missing values. Is there an SQL Select statement (its ok to use more than one) that will return the first x items that are NOT present in the column?
>>
>>TIA,
>>
>>Alex

That will suit my purpose, Tore, thank you. I will only be only looking for the first gap which I will use as the next id (in case somehow the value on the "next index" table has gone over the top). Hope it runs fast.

Alex
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform