Questions tagged [snowsql]

3 questions
2
votes
0 answers

SnowFlake/SnowSQL: Compilation Scripts

In Oracle/Postgres it is possible to write a script that will run other scripts/files such as compile_script.sql (contains) @script1.sql @script2.sql @script3.sql When you run compile_script.sql it runs all three of those scripts. In snowSQL…
Joe W
  • 1,058
  • 9
  • 20
1
vote
1 answer

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

The first CTE grabs all patients with the diagnosis codes for substance abuse, the second CTE should filter down to only NEW paitents. Meaning of the people in the first CTE, which of thses people have noy been diagnosised with the 2 codes before.…
Michelle
  • 21
  • 2
1
vote
0 answers

How to have another column showing first date from partiton by clause?

select distinct ea.FIN , dem.patient_name , dem.dob , age_in_years(e.beg_effective_dt_tm::date, dem.dob) as Age_at_Encounter , cv.display as Facility , cv2.display as Nurse_unit , cv3.display as Loc , cv4.display as Encounter_Type ,…
Michelle
  • 21
  • 2