hi sir i used this code for solving this problem: code: with recursive cte as ( select item,1 as total from items union all select distinct c.item,total + 1 as total from cte c join items i on c.total < i.item_count and c.item = i.item ) select * from cte order by item,total
@joemoneyweather44373 ай бұрын
With cte as ( select item,item_count from items union all select item,item_count-1 from cte where item_count>=2 ) select * from cte order by item,item_count
@srinivasulum4142 ай бұрын
with cte as ( select item,item_count,1 as num from items union all select item,item_count,num+1 from cte where num+1
@torrentdownloada3 ай бұрын
with cte as(select item,item_count from items union all select item,item_count-1 from cte where item_count>1) select * from cte order by item,item_count
@syedirfanali80433 ай бұрын
Sir i am beginner in SQL Request to post beginner tutorial 🙏🏻please sir I want to learn SQL
@vishnugottipati93733 ай бұрын
with cte as( select item,item_count from items1 union all select cte.item,cte.item_count-1 from cte inner join items1 i on cte.item=i.item where cte.item_count>1 ) select item,item_count from cte order by item,item_count
@VARUNTEJA733 ай бұрын
with r_cte as (select item,1 as number,item_count from items union all select item,number+1,item_count from r_cte where number
@vishalsvits3 ай бұрын
with cts AS ( select item , item_count, 1 AS Ctn From items union all select c.item , c.item_count ,c.ctn+1 from items i join cts c on c.item_count =i.item_count and i.item_count>c.Ctn ) select item, ctn From cts order by item
@manjunatharalikatti22026 күн бұрын
;WITH CTE AS ( SELECT item,1 AS cnt,item_count FROM items UNION ALL SELECT item,cnt+1 AS cnt,item_count from CTE WHERE cnt < item_count ) SELECT * FROM CTE order BY item,cnt,item_count
@nd92673 ай бұрын
;with cte as ( select item, sum(item_count) total_count, 1 as level from items_item group by item union all select item, total_count, level+1 from cte where level+1
@MeanLifeStudies3 ай бұрын
Looks more optimized than my solution
@motiali68552 ай бұрын
My Solution: with recursive cte as ( select item,item_count, 1 as level from items union all select cte.item,cte.item_count-1, (level+1) as level from cte where cte.item_count>1 ) select cte.item,cte.item_count from cte order by cte.item,cte.item_count;
@hrishi283920 күн бұрын
got more clearity from your query thbxxx
@arjundev49083 ай бұрын
WITH RECURSIVE CTE AS(SELECT *, 1 AS JUM FROM ITEMS UNION ALL SELECT C.ITEM,C.ITEM_COUNT-1, JUM+1 AS LEVEL FROM CTE AS C JOIN ITEMS AS I ON C.item_count = I.item_count WHERE C.ITEM_COUNT > 1) SELECT * FROM CTE ORDER BY 1;
@harshitsalecha2212 ай бұрын
WITH recursive cte1 AS (SELECT item,item_count,1 as number FROM items UNION ALL SELECT item,item_count,number+1 FROM cte1 WHERE number
@shwetas43883 ай бұрын
Data analyst interview prep krva do
@MeanLifeStudies3 ай бұрын
Okay
@noobvirago38743 ай бұрын
PL SQL Developer Tool With cte as ( Select level as lvl from dual connect by level =lvl;