Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

0 votes

creating a CTE to filter previous CTE populaiton down. How to find new diagnosis of certain ICD 10 code?

CREATE OR REPLACE TEMP TABLE EXAMPLE_DATA (person_id INT, diag_dt_tm TIMESTAMP_NTZ(9)); INSERT INTO EXAMPLE_DATA (person_id, diag_dt_tm) VALUES (1, '2000-01-01'), -- 1 has 3 appearances (1, '...
MackM's user avatar
  • 101
1 vote

Getting sum for each day based on most recent timestamp entry for each entity

One way to achieve this is: First, creates the tables (#tableA with your source , #tmpDateSequence with a list of days = 2024-02-03 ,2024-02-04 ,2024-02-05...) drop table if exists #tmpDateSequence,#...
Sabin B's user avatar
  • 4,436

Top 50 recent answers are included