Consecutive Numbers | Leetcode 180 | Crack SQL Interviews in 50 Qs

Поделиться
HTML-код
  • Опубликовано: 4 дек 2024

Комментарии • 20

  • @learnwithchirag
    @learnwithchirag  8 месяцев назад

    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! 💡

  • @uncreativeovertake
    @uncreativeovertake 5 месяцев назад +1

    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?

  • @apoorvpradhan5125
    @apoorvpradhan5125 4 месяца назад

    Thanks bhaiya !

  • @MayankRathore-qi7qv
    @MayankRathore-qi7qv 4 месяца назад

    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

  • @abhishekpatwal3827
    @abhishekpatwal3827 10 месяцев назад

    We can also use lead()

    • @learnwithchirag
      @learnwithchirag  10 месяцев назад

      Yes , there can be many ways of solving a question in SQL.... Do share your solution here , It will help others .....
      Keep watching 🎉

  • @rishavraj7318
    @rishavraj7318 5 месяцев назад

    Thanks and one suggestion is try to explain more on the logical part even if video gets long.

    • @learnwithchirag
      @learnwithchirag  5 месяцев назад +1

      Sure Noted 👍 Will do it and glad the video was helpful 💯💐

  • @mohammedmaqdoom4410
    @mohammedmaqdoom4410 6 месяцев назад

    thanks chirag this side

  • @gautammakharia6545
    @gautammakharia6545 Месяц назад

    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;

  • @shivamshukla9745
    @shivamshukla9745 5 месяцев назад

    use group by l1.num for the submission or generalized answer

  • @redeagle6580
    @redeagle6580 9 месяцев назад

    try to use diagrams and flowchart

    • @learnwithchirag
      @learnwithchirag  9 месяцев назад +2

      Sure buddy..... I will try to add it to my upcoming videos...💫

  • @nimbu_03
    @nimbu_03 11 месяцев назад

    Got Stuck.... noice

  • @adarshjha5126
    @adarshjha5126 4 месяца назад

    Bhai pahale smajhaya jata hai fhir query likhte hai

  • @akhilpratapsingh3223
    @akhilpratapsingh3223 Год назад