Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL in batches of 100
Message
De
13/02/2009 18:39:53
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
13/02/2009 16:21:30
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:
01381657
Message ID:
01381679
Vues:
56
>Let's say I have a table with 950 records. I want to select the first 100, do something, the next 100, do something, etc., then select the final 50, do something. It is the same something, I just only want to process 100 at a time.

lastValue = 0

select top 100 * from yourTable where yourPrimaryKey > m.lastValue order by yourPrimaryKey
* ...
* and assign max primaryKey in this set to lastValue

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