4 ms·
It's late and I'm tired and far from a SQL expert, so this may be a silly question, but why is the dense_rank needed instead of just using the event's timestamp
by fred256 9y ago
It's late and I'm tired and far from a SQL expert, so this may be a silly question, but why is the dense_rank needed instead of just using the event's timestamp directly in the 2nd query?
- pulisse 9y agoTo break ties when there are multiple events with the same timestamp, I would guess.
- sudhirj 9y agoWith or without a dense rank a second sort order would be necessary to break ties.
- sitharus 9y agoThe timestamp would work fine, but if you do a dense_rank you could easily include the number of events per message. They're not doing that in the example but perhaps the application they're basing the blog on does.