0

我正在尝试通过在 pl/SQL 函数中使用循环在 LOV 项中列出数字(例如从 1 到 20)。这一定是可能的,但我还没有成功。感谢您的宝贵帮助。

4

1 回答 1

1

No need to do pl/sql, this can be achieved using the pseudo column LEVEL and the CONNECT BY clause in pure SQL. Very useful for selects like date lists, number lists, etc. For a list of numbers from 1 to 20 you could do this:

SELECT
  level  AS display_value,
  level  AS return_value
  FROM
  dual
CONNECT BY
  level <= 20
于 2021-02-05T07:56:21.647 回答