Skip to main content
16 events
when toggle format what by license comment
Nov 13, 2024 at 15:45 comment added mpag LAG is a set-based windowing function; You are trying to use it like an iterative do-while loop. I may work up a solution for you that doesn't involve the LAG, greatest or row_number. But a question to you: do you anticipate that any dates are legitimately pre-1970? It appears that you are using Jan 1, 1970 as a "magic value". Why not just leave those as NULL? i.e. does any of your downstream logic depend on having a defined value there? Edit: just noticed this is a retro thread despite it being on the front page of dba.
Nov 13, 2024 at 14:01 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Jul 16, 2024 at 12:08 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Mar 18, 2024 at 4:06 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Nov 17, 2023 at 12:03 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Jul 18, 2023 at 19:01 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Mar 15, 2023 at 16:07 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Nov 11, 2022 at 5:01 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Jul 3, 2022 at 12:07 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Mar 15, 2022 at 13:50 vote accept Eugene Choi
Mar 15, 2022 at 14:03
Mar 15, 2022 at 1:16 answer added Avarkx timeline score: 1
Mar 11, 2022 at 16:52 history edited Eugene Choi CC BY-SA 4.0
deleted 696 characters in body
Mar 11, 2022 at 16:44 history edited Eugene Choi CC BY-SA 4.0
added 3283 characters in body
Mar 11, 2022 at 15:51 comment added Bob Klimes providing tables schemas, sample data, and full query will get you better help. your window functions works correctly in SQL server ( all i have) but that may be more complexities to your query that is resulting in your issue or it may be an athena issue. grasping at straws, but maybe try order by coalesce(cm_date,cmi_date) instead of event_at
S Mar 11, 2022 at 15:11 review First questions
Mar 15, 2022 at 1:19
S Mar 11, 2022 at 15:11 history asked Eugene Choi CC BY-SA 4.0