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.
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
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
@@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
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!!
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.
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.
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. ?
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
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
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...
-- 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.
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.
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
GREAT TEACHER! I have been using your videos to reference SQL where I have no clues. Thanks for all your hard works!
Very well explained! Keep making such amazing tutorials!
Thank you! After many videos, I finally get it! 👍🏾🎉🙏🏾
man you r hell of a teacher thanks
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.
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
@@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
Save me from some headaches. Thank you !
God bless you!
Wow. You explain like a G!!! Gang gang. God bless
Nice teacher I have ever seen
Your explanation was amazing....Tq very much
Thank you so much, you videos are addictive great explanation.
Thank you Sir, easily the best tutorial teacher
Thank you, love your videos.
Great channel, please keep doing these videos. You are the teacher i never had.
Great videos, big thanks to venkat!
Thank you so much for sharing, very clear explanation 🌹👍👍
Cystal clear explanation!
Very helpful as usual.
me si sirvio bastante, a pesar de estar en ingles , logre enteder la idea del ROW NUMBER . Muchas gracias
Excellent explanation.
This is very informative. Thank you so much!
nice sir..i watch your ASP and SQL video Series
Thanks again for a great tutorial.
thanks . very helpful
Great explanation! Thank you
Thank you Venkat. You are helping me a lot. Please make a video how we can rollback our database to a given point.
Well explained, going forward I am going to search any sql issue with your name on youtube.
I was looking for this thank you so much
Very good tutorial Venkat :) thank you
Great video, thanks a lot !
Thanks Venkat it was well don Tutorial
very helpful thanks kudvenkat!
thanx alot your videos is helping me
Great explanation! Thx!
very good video, flawless
thank you Venkat Sir
You are amazing!
nice !
Great!! Thanks!
well explained
Fantastic:)
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!!
This helped me a lot, thanks!
very well explained, thank you, where's your tip cup lol
thank you very good
Great
Please add plsql tutorial videos as well!
Hi Venkat, Thanks for these tutorials. One request. Can you create some tutorials on big query? Thanks
Thanks.
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.
Thank u sir.
Wonderful
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.
How come when you delete from the CTE you also delete from the original table?
Hello sir, pls make video on table partitioning and their concept...this is something important which is not made yet
I have seen several of you videos that reference Partition. What does that do?
superb sir. I have one doubt how to partition the row_number by alphabetical order sir
I have sent an email and still waiting for reply. Thumbs up for this video.
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. ?
can we use one more where clause with row number...?
Hi it is possible to update all the results send by the row_number with another valure from another table ?
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
query seems ok can you please post ur sample data so that we can help.
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
what is employee cte is that the table name?
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...
What if you only want to return the row with the max row number?
-- 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.
archrodney thanks
I tried it but got an error message saying no column as rownumber
Hey guys help me how to find odd rows and even rows
Very well explained! Thank you