Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL advice
Message
From
08/10/1997 14:19:41
 
 
To
08/10/1997 14:02:10
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00053745
Message ID:
00053751
Views:
26
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform