  SET QUOTES=NULL
  SET QUOTES="
  SET DELIMIT=NULL
  SET DELIMIT=","
  SET LINEEND=NULL
  SET LINEEND="^"
  SET SEMI=NULL
  SET SEMI=";"
  SET PLUS=NULL
  SET PLUS="+"
  SET SINGLE=NULL
  SET SINGLE="_"
  SET MANY=NULL
  SET MANY="%"
  SET IDQUOTES=NULL
  SET IDQUOTES="`"
  SET CURRENCY "$" PREF 2 B
  DISCONNECT
  SET STATICDB OFF
  SET ROWLOCKS ON
  SET FASTLOCK OFF
  CREATE SCHEMA AUTHOR testquery PUBLIC
  CREATE TABLE `QueryTest` +
      (`RowID` INTEGER, +
      `PartID` TEXT (12), +
      `ID1` TEXT (8), +
      `ID2` TEXT (8))
  COMMENT ON TABLE `QueryTest` +
    IS "Find rows where ID1 = ID2 from previous row"
  ALTER TABLE querytest ALTER COLUMN id1 TEXT (8)
  ALTER TABLE querytest ALTER COLUMN id2 TEXT (8)
  LOAD querytest
1,"PV216365006R","-00105","-00106"
2,"PV216365006R","-00106","-00105"
3,"PV216365006R","-00107","-00108"
4,"PV216365006R","-00108","-00107"
5,"PV216365006R","-00109","-00110"
6,"PV216365006R","-00110","-00109"
7,"PV216365006R","-00111","-00112"
8,"PV216365006R","-00112","-00111"
  END
  BROWSE partid,t1.rowid,t1.id1,t2.id2 +
    FROM querytest t1, querytest t2 +
    WHERE t1.partid = t2.partid +
      AND t2.rowid = (t1.rowid + 1) +
      AND t1.id1 = t2.id2
  RETURN
