The following example replaces the existing definition for the recursive view named rec with the specified SQL code:
REPLACE RECURSIVE VIEW rec(p, mycount) AS ( SELECT n, 0 AS mycount FROM t WHERE n = 1 UNION ALL SELECT rec.p, rec.mycount + 1 FROM t, rec WHERE rec.p = t.n AND rec.mycount <= 20