ohdsi-studies / PioneerWatchfulWaiting

This study is part of the joint PIONEER - EHDEN - OHDSI studyathon in March 2021, and aims to advance understanding of clinical management and outcomes of watchful waiting in prostate cancer.
Apache License 2.0
7 stars 18 forks source link

SQL-render friendly statements #78

Closed Jake-Gillberg closed 3 years ago

Jake-Gillberg commented 3 years ago

Changes needed to run the study at Tufts Medical Center

SQL that is closer to conforming to these rules: https://ohdsi.github.io/SqlRender/articles/UsingSqlRender.html#functions-and-structures-supported-by-translate-1

DROP IF EXISTS -> IF OBJECT_ID IS NOT NULL DROP

CREATE TABLE AS -> SELECT INTO

UPDATE table alias FROM join_table -> UPDATE table FROM table INNER JOIN join_table

CEIL -> CEILING

GROUP BY 1 -> GROUP BY coulmn_name

keesvanbochove commented 3 years ago

Thanks, I confirmed that this works in Postgres also! Hopefully it will work in the other databases as well.