With CTE in SQL | Common Table Expression | Find nth Max Salary in SQL

Поделиться
HTML-код
  • Опубликовано: 16 окт 2024
  • With CTE in SQL | Common Table Expression | Find nth Max Salary in SQL
    Blog - www.testerhoon.com
    Explained -
    Syntax
    -Usage
    -example to find out nth max salary number
    #sql
    #etltesting

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

  • @kameswari11
    @kameswari11 Год назад +1

    Awesome!! Excellent explanation thank you.

  • @ashishkumar-on8xg
    @ashishkumar-on8xg 5 месяцев назад

    Thankyou for this informative video, explained in very clear and simple way. Thanks

  • @VikramSingh-st8jd
    @VikramSingh-st8jd Год назад +1

    Great work Miss👍

  • @Crazy_Experimental_Show
    @Crazy_Experimental_Show Год назад +1

    Keep doing good work

  • @HaroonKhan-pz8wb
    @HaroonKhan-pz8wb Год назад +1

    Very informative thanks for sharing such a video. Please make video on real time ETL tool.

  • @amitprasad5471
    @amitprasad5471 Год назад +1

    Very informative content..👍
    Ma'am, please Azure Data k basic bhi btye..

  • @VikramSingh-st8jd
    @VikramSingh-st8jd Год назад +1

    Please bring more lecture videos asap

  • @kartikjuneja7807
    @kartikjuneja7807 Год назад +1

    Hello Mam,
    What if we have the same salary for 3 persons/ids ?

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

      then all will fall under the same rank.. 🙏

  • @mrrahaman6246
    @mrrahaman6246 Год назад +1

    If there is a duplicate records in salary column then how it will work???

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

      in that case use dense_rank() function 🙏

  • @thelayer5211
    @thelayer5211 Год назад +1

    I don't know why but I feel this is wrong bcoz I always used dense_rank() if there r duplicate records that condition if we r used row_number then v get wrong output

    • @testerhoon28
      @testerhoon28  Год назад +1

      this i have used for my test data with 5 records and all having different salary... u could use dense rank if u have multiple same salary... 🙏

  • @krishnay.233
    @krishnay.233 Год назад

    Here, we have to hardcode the count value of row number to get the nth salary, is there a way to make this query more dynamic?

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

      you could copy that code and make stored procedure and pass as a variable..

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

    How to use Row Number when we have duplicate or same salary numbers.

    • @testerhoon28
      @testerhoon28  Год назад +1

      in that case u could use dense rank instead of row number...

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

    Mam in how many we can be perfect in SQL

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

      Practice Practice and practice... thats the only way to bcm perfect 🙏✌

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

    ma'am i think this is a wrong function you used.
    for nth max salary we use dense_rank()
    beacuse if the salary is duplicate then how row_number() works?
    you didn't take duplicate salary thats why the ans is showing right..
    but i said this is wrong..
    ma'am please correct me if i am wrong...🙏

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

      in the given example no duplicate data i took hence used it..... if there are duplicate u have to use dense_rank...

  • @gauravsingh8274
    @gauravsingh8274 Год назад +2

    You can do it simply but why did you use cte for that

    • @testerhoon28
      @testerhoon28  Год назад +1

      yes, we can do it.. just to explain the CTE i have used it.. m🙏

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

      i am asking difference between cte for simply query

    • @testerhoon28
      @testerhoon28  Год назад +1

      @@gauravsingh8274 CTE we use to store a resultset that we can use further in the query... its up to u... u could use it anywhere as per ur need..

    • @gauravsingh8274
      @gauravsingh8274 Год назад +1

      @@testerhoon28 ok waiting you videos

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

    Now a days interviewers ask very complex query what can I do now

    • @testerhoon28
      @testerhoon28  Год назад +2

      that comes from practice... the more u practice on real scenerios .. the more u get expertize on sql.. 🙏

  • @RimaraniMeher
    @RimaraniMeher 10 месяцев назад +1

    It's not desc order maam

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

      you can either use Describe or Desc

  • @akshaydudhe9395
    @akshaydudhe9395 Год назад +1

    can you please share ur LinkedIn?

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

      I do not have LinkedIn account... 🙏

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

      @@testerhoon28 Can you please refer me in IBM for Azure data engineer role?

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

      @@akshaydudhe9395 pls share ur resume at tmadamji@gmail.com

    • @akshaydudhe9395
      @akshaydudhe9395 Год назад +1

      @@testerhoon28 yes sent