Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL advice
Message
De
08/10/1997 14:19:41
 
 
À
08/10/1997 14:02:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00053745
Message ID:
00053751
Vues:
32
>Hello, All !
>I'm looking for the advice on SQL. I am SELECTing records from a table. Let's say I have fields F1 and F2, and F1 must be true, if for the PREVIOUS record in the resulting set field F2 == "smthg". Is there any simple way to do this using SQL?
>TIA,
>Alex.

IMHO it's more appropriate to use SCAN, but if you want SQL, it's Ok:
Select recno() as recno From table1 Into cursor tmp1
Select recno()+1 as recno, F2 From table1 Into cursor tmp2
Select .f. as F1,F2 From tmp1,tmp2 Into Table tmp3 Where tmp1.recno=tmp2.recno
Update tmp3 Set F1=.T. Where F2="smthg"
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform