递归
WITH RECURSIVE t(n) AS (
values(1)
UNION ALL
SELECT (n + 1) as n FROM t WHERE n in (1,2,3)
)
select * from t;
传参:
PREPARE myquery FROM
SELECT userKey,userValue, (userValue * ?) as newUserValue
FROM (values(1,10),(2,20),(3,30)) as t(userKey,userValue)
WHERE userKey = ?;
EXECUTE myquery USING 10,1
EXECUTE myquery USING 20,1