Real Time SQL Interview Queries|| Multiple CTE's with First_Value() Function

  Рет қаралды 1,830

Mohit Tyagi

Mohit Tyagi

Күн бұрын

Пікірлер: 6
@in6tinct
@in6tinct Ай бұрын
"very poor choice of aliases" 😂 Jk thanks great question and answer
@g4uravrawat663
@g4uravrawat663 11 күн бұрын
😂
@HARSHRAJ-gp6ve
@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
@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
@A8OC
@A8OC Ай бұрын
Hmm, a republish might be in order 🫢
Real Time SQL Interview Queries|| Technical Round || PART-3
12:39
Zomato SQL Interview Question | Using CTEs | Advanced SQL
14:37
Nishtha Nagar
Рет қаралды 14 М.
兔子姐姐最终逃走了吗?#小丑#兔子警官#家庭
00:58
小蚂蚁和小宇宙
Рет қаралды 15 МЛН
How Strong is Tin Foil? 💪
00:25
Brianna
Рет қаралды 57 МЛН
WIPRO SQL Interview Question - FIRST_VALUE( ) Function
11:18
Cloud Challengers
Рет қаралды 15 М.
Real Time SQL Interview Queries|| Technical Round || PART-1
24:12
Making Minecraft 100x faster (by rewriting it in Rust)
17:02
Theo - t3․gg
Рет қаралды 37 М.
Real Time SQL Interview Queries|| Technical Round ||
6:22
Mohit Tyagi
Рет қаралды 574
What's Killing all the iMacs?
12:29
Action Retro
Рет қаралды 13 М.
Unit 15 Sample Problems Discussion
16:09
Rommel Apostol
Рет қаралды 200