I want to write a SQL query which accepts a bind variable (say :NUM) and its output consists of one column & :NUM number of rows, each row having its row number. i.e. if we
Depends on database various method can be used.
PostgreSQL has a nice feature -- series.
To get what you want just want:
SELECT * FROM generate_series(1, NUM);