Hey there! 👋 For more interesting content, tutorials, and updates, Feel free to connect with me on Instagram Handles :- @createwithchirag - instagram.com/createwithchirag/ @learn.with.chirag - instagram.com/learn.with.chirag/ LinkedIn: www.linkedin.com/in/chirag-sehgal-9200111b8/ Let's stay connected and keep the creativity flowing! 💡
select distinct num as ConsecutiveNums from Logs where id in (select id from logs where id =3 ) i try to do this but after 15 test case it doest not work pls give advice where i mistake
SELECT DISTINCT num AS ConsecutiveNums FROM ( SELECT num, LAG(num, 1) OVER (ORDER BY id) AS prev_num, LEAD(num, 1) OVER (ORDER BY id) AS next_num FROM Logs ) AS temp WHERE num = prev_num AND num = next_num;
Hey there! 👋 For more interesting content, tutorials, and updates, Feel free to connect with me on
Instagram Handles :-
@createwithchirag - instagram.com/createwithchirag/
@learn.with.chirag - instagram.com/learn.with.chirag/
LinkedIn: www.linkedin.com/in/chirag-sehgal-9200111b8/
Let's stay connected and keep the creativity flowing! 💡
Hello Sir,
In this, If we have given that appears num at-least 10 times or more then 10 times , then which approach will apply?
Thanks bhaiya !
select distinct num as ConsecutiveNums
from Logs
where id in (select id from logs where id =3 ) i try to do this but after 15 test case it doest not work
pls give advice where i mistake
We can also use lead()
Yes , there can be many ways of solving a question in SQL.... Do share your solution here , It will help others .....
Keep watching 🎉
Thanks and one suggestion is try to explain more on the logical part even if video gets long.
Sure Noted 👍 Will do it and glad the video was helpful 💯💐
thanks chirag this side
Glad it was helpful to you 💐
SELECT DISTINCT num AS ConsecutiveNums
FROM (
SELECT num,
LAG(num, 1) OVER (ORDER BY id) AS prev_num,
LEAD(num, 1) OVER (ORDER BY id) AS next_num
FROM Logs
) AS temp
WHERE num = prev_num AND num = next_num;
use group by l1.num for the submission or generalized answer
try to use diagrams and flowchart
Sure buddy..... I will try to add it to my upcoming videos...💫
Got Stuck.... noice
Atleast you tried 💯
Bhai pahale smajhaya jata hai fhir query likhte hai
achha bhai
💯