I have been looking for a way to do this for about 3 weeks for a work project and you saved me… thank you lol
@SQLServer10110 ай бұрын
Hi Random. I'm glad that I could help. Phillip
@krishnakamalgogoi98935 ай бұрын
with cte3 as (select *, ROW_NUMBER() over(partition by Region order by Pricedate desc) as region_rnk from tblhouseprices) select * from cte3 where region_rnk = 1
@itsgroovylue10 ай бұрын
You absolutely saved my day my friend!! Thank you!
@nonoobott8602 Жыл бұрын
Absolutely brilliant. This is so useful. Thanks for sharing
@diegocosta168 Жыл бұрын
Great! Helped me a lot 👏👏👏
@minnrick79862 жыл бұрын
Thanks! CTE seems the most elegant to me :)
@SQLServer1012 жыл бұрын
Thanks - I do like CTEs, as they can simplify nested subqueries - which we'll be having a look at in the next video. Phillip
@taibabs12222 жыл бұрын
You could also put the query into a temp table as suppose to a CTE.
@Mnfls Жыл бұрын
This is 🤯
@ElWiwif Жыл бұрын
You rock!! Thanks!!
@danramirz2 жыл бұрын
Thanks for this video!
@dangkhanhlinh476 Жыл бұрын
nice!
@jacekk7819 Жыл бұрын
I`m not sure why but my CTE with ROW_NUMBER is faster than other two , query plan showing me 22% , 39% , 39% for query cost
@SQLServer101 Жыл бұрын
Hi Jacek. Very interesting - it's good a) to be able to have multiple ways to do the same thing, and b) to see which is faster! Phillip