"very poor choice of aliases" 😂 Jk thanks great question and answer
@g4uravrawat66311 күн бұрын
😂
@HARSHRAJ-gp6veАй бұрын
with cte as( select table1.*,ROW_NUMBER()OVER() as x1 FROM table1 ),cte1 as( select category,x1 FROM cte where category!='Null1' ),cte2 as( select category,x1,COALESCE(LEAD(x1)OVER()-1,(select COUNT(*) FROM table1)) as x2 FROM cte1 ) select cte2.category,cte.Brand FROM cte2 JOIN cte ON cte.x1 BETWEEN cte2.x1 and cte2.x2; Mohit sir,if you find my query correct then react on my query,i just update null tonull1 to reduce chance of error
@mohittyagi9141Ай бұрын
Hi, you code need to be edit like pass alteast one parameter within over(), no need for 3 cte which make query little complex