Row Number function in SQL Server

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 พ.ย. 2024

ความคิดเห็น • 77

  • @krzysztofs8535
    @krzysztofs8535 7 ปีที่แล้ว +34

    Row number rules ! And Venkat rules! You are the best teacher on youtube and in the whole world. I saw all your videos from SQL Server tutorial. Thank U for educating community! God bless you.

  • @piyako3586
    @piyako3586 6 หลายเดือนก่อน +1

    Tried so many videos on TH-cam after a few minutes I come out of it as I don't understand what they are talking about. You are the best:) Explained all concepts very clearly I found not just a good teacher but also a great soul :) Your voice is very soothing and pleasant on the ears wanting to listen more and more. God Bless you and Thanks once again

  • @tenziny9253
    @tenziny9253 7 ปีที่แล้ว +6

    GREAT TEACHER! I have been using your videos to reference SQL where I have no clues. Thanks for all your hard works!

  • @sayeedm6038
    @sayeedm6038 3 ปีที่แล้ว +3

    Very well explained! Keep making such amazing tutorials!

  • @aprillong4805
    @aprillong4805 2 ปีที่แล้ว

    Thank you! After many videos, I finally get it! 👍🏾🎉🙏🏾

  • @yahyamlaouhi9508
    @yahyamlaouhi9508 4 ปีที่แล้ว

    man you r hell of a teacher thanks

  • @MrHorzel
    @MrHorzel 8 ปีที่แล้ว +5

    Really well explained. Thank you. I really appreciate that you explained the use of it, more people should add that 'cause it's not always clear.

    • @Csharp-video-tutorialsBlogspot
      @Csharp-video-tutorialsBlogspot  8 ปีที่แล้ว +2

      You are very welcome and thank you very much for taking time to give feedback. This means a lot. I am very glad you found the videos useful.
      I have organised all the Dot Net & SQL Server videos in to playlists, which could be useful to you
      th-cam.com/users/kudvenkatplaylists?view=1&sort=dd
      If you need DVDs or to download all the videos for offline viewing please visit
      www.pragimtech.com/kudvenkat_dvd.aspx
      Slides and Text Version of the videos can be found on my blog
      csharp-video-tutorials.blogspot.com
      Tips to effectively use my youtube channel.
      th-cam.com/video/y780MwhY70s/w-d-xo.html
      If you want to receive email alerts, when new videos are uploaded, please subscribe to my youtube channel.
      th-cam.com/users/kudvenkat
      If you like these videos, please click on the THUMBS UP button below the video.
      May I ask you for a favor. I want these tutorials to be helpful for as many people as possible. Please share the link with your friends and family who you think would also benefit from them.
      Good Luck
      Venkat

    • @sudhakarjampanna3945
      @sudhakarjampanna3945 4 ปีที่แล้ว

      @@Csharp-video-tutorialsBlogspot - Do you provide training on SQL SERVER DBA /Azure DBA..or any videos on Clustering and login users /different types of roles or access in sql. my number 9030014648

  • @Quangnguyen1696
    @Quangnguyen1696 3 ปีที่แล้ว

    Save me from some headaches. Thank you !

  • @bahadirezici
    @bahadirezici 5 ปีที่แล้ว +6

    God bless you!

  • @AbhishekKumar-vo7wr
    @AbhishekKumar-vo7wr 5 ปีที่แล้ว +1

    Wow. You explain like a G!!! Gang gang. God bless

  • @grreddy2811
    @grreddy2811 2 ปีที่แล้ว

    Nice teacher I have ever seen

  • @rajeshkumar-ii8bb
    @rajeshkumar-ii8bb 2 ปีที่แล้ว

    Your explanation was amazing....Tq very much

  • @mohamedabbes6064
    @mohamedabbes6064 2 ปีที่แล้ว

    Thank you so much, you videos are addictive great explanation.

  • @shahidurislam4646
    @shahidurislam4646 4 ปีที่แล้ว

    Thank you Sir, easily the best tutorial teacher

  • @GenerallyGoodMusic
    @GenerallyGoodMusic ปีที่แล้ว

    Thank you, love your videos.

  • @cool-as-cucumber
    @cool-as-cucumber 8 ปีที่แล้ว

    Great channel, please keep doing these videos. You are the teacher i never had.

  • @tusharmehrotra647
    @tusharmehrotra647 3 ปีที่แล้ว

    Great videos, big thanks to venkat!

  • @kebincui
    @kebincui 3 ปีที่แล้ว

    Thank you so much for sharing, very clear explanation 🌹👍👍

  • @brindhaganesan3580
    @brindhaganesan3580 6 ปีที่แล้ว

    Cystal clear explanation!

  • @dawitworku821
    @dawitworku821 7 หลายเดือนก่อน

    Very helpful as usual.

  • @Oxidado86
    @Oxidado86 5 ปีที่แล้ว +1

    me si sirvio bastante, a pesar de estar en ingles , logre enteder la idea del ROW NUMBER . Muchas gracias

  • @jackfrost8969
    @jackfrost8969 9 หลายเดือนก่อน

    Excellent explanation.

  • @seanm8362
    @seanm8362 4 ปีที่แล้ว

    This is very informative. Thank you so much!

  • @ramachandranm4210
    @ramachandranm4210 9 ปีที่แล้ว +1

    nice sir..i watch your ASP and SQL video Series

  • @FaeUtero
    @FaeUtero 3 ปีที่แล้ว

    Thanks again for a great tutorial.

  • @jitsharma88
    @jitsharma88 ปีที่แล้ว

    thanks . very helpful

  • @tempura_edward4330
    @tempura_edward4330 3 ปีที่แล้ว

    Great explanation! Thank you

  • @gosmart_always
    @gosmart_always 5 ปีที่แล้ว +1

    Thank you Venkat. You are helping me a lot. Please make a video how we can rollback our database to a given point.

  • @ravishankar0901
    @ravishankar0901 4 ปีที่แล้ว

    Well explained, going forward I am going to search any sql issue with your name on youtube.

  • @Alam_Syed
    @Alam_Syed 6 ปีที่แล้ว +1

    I was looking for this thank you so much

  • @Toofan2704
    @Toofan2704 4 ปีที่แล้ว

    Very good tutorial Venkat :) thank you

  • @kevinjia1984
    @kevinjia1984 3 ปีที่แล้ว

    Great video, thanks a lot !

  • @ashrafomer5297
    @ashrafomer5297 5 ปีที่แล้ว

    Thanks Venkat it was well don Tutorial

  • @CichyObserwator123
    @CichyObserwator123 6 ปีที่แล้ว

    very helpful thanks kudvenkat!

  • @loayoraby674
    @loayoraby674 6 ปีที่แล้ว

    thanx alot your videos is helping me

  • @SinhaFps
    @SinhaFps 4 ปีที่แล้ว

    Great explanation! Thx!

  • @jaspreetdandiwal
    @jaspreetdandiwal 7 ปีที่แล้ว

    very good video, flawless

  • @ashutoshhegde7290
    @ashutoshhegde7290 6 ปีที่แล้ว

    thank you Venkat Sir

  • @huiqingxu5286
    @huiqingxu5286 5 ปีที่แล้ว

    You are amazing!

  • @hungcao1342
    @hungcao1342 2 ปีที่แล้ว

    nice !

  • @evgenyr7127
    @evgenyr7127 6 ปีที่แล้ว

    Great!! Thanks!

  • @dollarmenu9618
    @dollarmenu9618 6 ปีที่แล้ว

    well explained

  • @chandrakumarreddyvennapusa7806
    @chandrakumarreddyvennapusa7806 4 ปีที่แล้ว

    Fantastic:)

  • @BeingSam7
    @BeingSam7 ปีที่แล้ว

    When we are populating the result set in subquery which is captured within CTE and then we are deleting only from that CTE itself, then how come the original table employee is getting affected?
    I have again watched the part where you have explained CTE but didn't understand this. Could you kindly help.
    Ohh and by the way the whole series is very helpful, KUDOS!! to you Venkat for helping so many people with your great knowledge and impeccable teaching talent!!

  • @meanmachineYT09
    @meanmachineYT09 6 ปีที่แล้ว

    This helped me a lot, thanks!

  • @20thCenturyFav
    @20thCenturyFav 10 หลายเดือนก่อน

    very well explained, thank you, where's your tip cup lol

  • @JohnWick-zv2mr
    @JohnWick-zv2mr 9 ปีที่แล้ว +1

    thank you very good

  • @dosovi4548bustayes
    @dosovi4548bustayes 9 ปีที่แล้ว +1

    Great

  • @gautamsham7291
    @gautamsham7291 3 ปีที่แล้ว

    Please add plsql tutorial videos as well!

  • @karnav43
    @karnav43 2 ปีที่แล้ว

    Hi Venkat, Thanks for these tutorials. One request. Can you create some tutorials on big query? Thanks

  • @raqibulAlam-su3jo
    @raqibulAlam-su3jo 9 ปีที่แล้ว +1

    Thanks.

  • @Archanaarchu-nd3xu
    @Archanaarchu-nd3xu 2 หลายเดือนก่อน

    Whether can v hav row_number as auto increment without repeating. First time if I m executing the select stt i should get 1,2,3 n if I m executing 2nd time i should get 4,5.

  • @kartikmondal4933
    @kartikmondal4933 6 ปีที่แล้ว

    Thank u sir.

  • @rifaqatullah2379
    @rifaqatullah2379 7 ปีที่แล้ว

    Wonderful

  • @angelmeist2652
    @angelmeist2652 ปีที่แล้ว

    can you explain in what order is the male part of the row number assigned after executing the commend... "Tom, Ron, Ben, Todd, Mark, John' does not come as the same order in the original table and it is not in any asc or desc order neither.

  • @DB-sf1hy
    @DB-sf1hy 4 ปีที่แล้ว +1

    How come when you delete from the CTE you also delete from the original table?

  • @samirkumar6180
    @samirkumar6180 3 ปีที่แล้ว

    Hello sir, pls make video on table partitioning and their concept...this is something important which is not made yet

  • @MrPlockey
    @MrPlockey 7 ปีที่แล้ว

    I have seen several of you videos that reference Partition. What does that do?

  • @nssramya8792
    @nssramya8792 2 ปีที่แล้ว

    superb sir. I have one doubt how to partition the row_number by alphabetical order sir

  • @wasimbader9170
    @wasimbader9170 9 ปีที่แล้ว

    I have sent an email and still waiting for reply. Thumbs up for this video.

  • @peternguyen9382
    @peternguyen9382 ปีที่แล้ว

    Hello Venkat, i dont understand why we delete the data from CTE it delete the data in the real table. I thought the data from CTE is the difference from the table. ?

  • @mahendrasinghbaghel3039
    @mahendrasinghbaghel3039 8 ปีที่แล้ว

    can we use one more where clause with row number...?

  • @NelsonZavala0509
    @NelsonZavala0509 4 ปีที่แล้ว

    Hi it is possible to update all the results send by the row_number with another valure from another table ?

  • @themachine225
    @themachine225 6 ปีที่แล้ว +1

    Hi, thanks for the video, this seems like a very simple function, i have tried it and it seems like its working by its actually returning an empty column, this is my exact code: ROW_NUMBER() OVER (PARTITION BY orddet_nl.invnum ORDER BY orddet_nl.invnum ASC) AS LineReference,
    i dont get any error messages or anything, but it just brings an empty column, any ideas why?
    Thanks

    • @ManishKumar-qx1kh
      @ManishKumar-qx1kh 3 ปีที่แล้ว

      query seems ok can you please post ur sample data so that we can help.

  • @venkataashok9460
    @venkataashok9460 2 ปีที่แล้ว

    its maximum row size exceeds the allowed maximum of 8060 bytes. INSERT or UPDATE to this table will fail if the resulting row exceeds the size limit. how to over come this warning

  • @aruneshdillikar4633
    @aruneshdillikar4633 3 ปีที่แล้ว

    what is employee cte is that the table name?

  • @leninmishra
    @leninmishra 8 ปีที่แล้ว

    Hi Venkat,
    I have data that has following rows....
    2934046 Kellogg’s Share Your Breakfast 74672 2407522 Kellogg?s Share Your Breakfast ACTIVE 2015-09-01 9999-12-31
    2934046 Kellogg?s Share Your Breakfast 74672 2407522 Kellogg?s Share Your Breakfast ACTIVE 2015-09-01 9999-12-31
    You can see that both rows are the same except for the question mark in the second row. I have to remove such rows from my table. I was trying to use row_number for this, but it doesn't work. Is there any way i can rank such rows based on the characters in my second column...

  • @hgoodman9
    @hgoodman9 8 ปีที่แล้ว

    What if you only want to return the row with the max row number?

    • @archrodney
      @archrodney 8 ปีที่แล้ว +1

      -- This query will give you 1 row with the max row number:
      SELECT TOP 1 *, ROW_NUMBER()OVER(PARTITION BY ID ORDER BY ID) AS RowNumber
      FROM Employees
      ORDER BY RowNumber DESC;
      -- This query will give you ALL rows with the max row number:
      WITH RowNumberCTE AS
      (
      SELECT *, ROW_NUMBER()OVER(PARTITION BY ID ORDER BY ID) AS RowNumber FROM Employees
      )
      SELECT * FROM RowNumberCTE WHERE RowNumber =
      (SELECT TOP 1 * FROM (SELECT ROW_NUMBER() OVER (PARTITION BY ID ORDER BY ID) AS RowNumbers FROM Employees) DerivedTable
      ORDER BY RowNumbers DESC)
      -- I know it's not a nice piece of code but it does the job.

    • @hgoodman9
      @hgoodman9 8 ปีที่แล้ว +1

      archrodney thanks

  • @jessejacob1850
    @jessejacob1850 4 ปีที่แล้ว

    I tried it but got an error message saying no column as rownumber

  • @veenitkarkhanis338
    @veenitkarkhanis338 5 ปีที่แล้ว

    Hey guys help me how to find odd rows and even rows

  • @mansimishra19
    @mansimishra19 2 ปีที่แล้ว

    Very well explained! Thank you