SQLite Forum

Repeat values n times
Login
@mzm2021, 

Thanks you so much dear for your kind help. Your explanation is up to the point. 

I got both the methods working very well for me. Both methods are formed of two parts as one is actual data to be fetched from the table and the other part triggers the repetition of running the query for that matter. 

I understand that;

WITH RECURSIVE counter(value) AS (SELECT 1 UNION ALL SELECT value + 1 FROM counter LIMIT (SELECT MAX(qty) FROM input))

is the recursive counter on the select statement to run for each row and;

SELECT * FROM input JOIN counter ON value <= qty;

is the actual query to fetch the data from the table.

The generate_series function is quite handy, easy and quick to understand as well. It's impacting the query by the counter with JOIN command. Absolutely amazing.

This did solve my problem.