Skip to main content

Timeline for Count Consecutive Codes

Current License: CC BY-SA 4.0

12 events
when toggle format what by license comment
May 7, 2019 at 8:04 vote accept TimVK
May 7, 2019 at 8:09
May 6, 2019 at 15:55 answer added McNets timeline score: 2
May 6, 2019 at 15:22 history edited Aaron Bertrand
edited tags
May 6, 2019 at 15:20 history edited TimVK CC BY-SA 4.0
added 252 characters in body
May 6, 2019 at 14:51 comment added Aaron Bertrand with a sort by ResourceID and then ReferenceDate - I'm not following your output, then. You have CodeID 1 with ResourceID 893, then 656, then 353. Those are not in order by ResourceID, and the dates corresponding to those ResourceIDs are also not used in any obvious way for sorting. Please provide better sample data that covers edge cases (like when a different code does interrupt the sequence and how that affects the count).
May 6, 2019 at 14:43 comment added TimVK @Cowthulhu It's just the consecutive records sorted by date, it does not always mean that the dates will follow up nicely. Sorry for not being complete on this.
May 6, 2019 at 14:24 history edited Josh Darnell CC BY-SA 4.0
added 933 characters in body; edited tags
May 6, 2019 at 14:14 comment added Cowthulhu Could you elaborate on what you mean by "Consecutive"? Resource 656 has a gap of 15 days between it's dates.
May 6, 2019 at 13:55 history edited TimVK
edited tags
May 6, 2019 at 13:54 comment added Akina Looks like trivial SELECT ResourceID, CodeID, COUNT(*) FROM table GROUP BY ResourceID, CodeID.
May 6, 2019 at 13:51 history edited user1822 CC BY-SA 4.0
added 614 characters in body; edited tags
May 6, 2019 at 13:42 history asked TimVK CC BY-SA 4.0