>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