There is a request with connect by . While writing, I encountered an error:
ORA-01436: CONNECT BY loop in user data
By advice from the Internet, I added the line prior dbms_random.value is not null .
select n, n + level n_sum, nvl(prior n, 0) + level - 1 as prior_sum from ( select 1 as n from dual ) connect by 1=1 and level < 10 and nvl(prior n, 0) + level - 1 in (1, 2, 3, 7) and prior dbms_random.value is not null; I do not like magic in the code, which I do not understand :)
Explain, please, why without this line my request loops, and how does adding a random house fix the situation?