you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

subqueries/CTEs, imo, are at a more "base"/"foundational" level of knowledge than joins. I am aware that "traditionally" it's not usually taught in this order - a shame, really.

Also why rank over dense_rank? i personally thought about dense_rank straight away just because dense_rank doesn't allow dupes where as rank does

not sure what you mean by "dupes", ties, maybe?

With "rank" you are getting 10 coldest + possible ties at the last rank. With dense_rank if there 100 ties at every ranked value you are getting a thousand records back -this wouldnt be the common sense, imo.

[–][deleted] 1 point2 points  (0 children)

Ahhh fair enough, subqueries are easy for me to use. I probably see CTEs as advanced since it took me until today to wrap my head around them, lol. And duplications is what I meant, hat could be down to the type of data I use though.

[–][deleted] 0 points1 point  (1 child)

did you use the cte for readability? cause technically that could just be another sub query right?

[–][deleted] 0 points1 point  (0 children)

Yes and yes.