Skip to content

Instantly share code, notes, and snippets.

@demarchenac
Created June 1, 2022 00:13
Show Gist options
  • Save demarchenac/cddd3cab8f1938173042106a6323ebd1 to your computer and use it in GitHub Desktop.
Save demarchenac/cddd3cab8f1938173042106a6323ebd1 to your computer and use it in GitHub Desktop.
A simple SQL to reset a cohort table on a given schema
DROP TABLE IF EXISTS @cdm_database_schema.@cohort_table;
CREATE TABLE IF NOT EXISTS @cdm_database_schema.@cohort_table (
"cohort_definition_id" integer NOT NULL,
"subject_id" integer NOT NULL,
"cohort_start_date" date NOT NULL,
"cohort_end_date" date NOT NULL
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment