Skip to content

Commit 4180721

Browse files
committed
fix: update file path and comments
1 parent a4ea8aa commit 4180721

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
-- SQL script to export a csv file containing NHS numbers of submitted responses to a folder on an AVD.
22
-- A valid response is defined as a response where the user has submitted the questionnaire.
3-
-- Run script using the psql command line tool on AVD; this file uses psql meta-commands (\set, \copy) and will not run in pgAdmin Query Tool.
3+
-- Run script using the psql command line tool on AVD.
4+
-- Update PATH_TO_EXPORT_FILE before running to specify the location and name of the exported file. The file will be created if it does not exist, or overwritten if it does.
45

56
\set ON_ERROR_STOP on
6-
\copy (SELECT DISTINCT qu.nhs_number FROM questions_user qu JOIN questions_responseset qrs ON qrs.user_id = qu.id WHERE qrs.submitted_at IS NOT NULL) TO 'C:/Users/*YourUsername*/Documents/valid_responses.csv' WITH (FORMAT csv, HEADER true);
7+
\copy (SELECT DISTINCT qu.nhs_number FROM questions_user qu JOIN questions_responseset qrs ON qrs.user_id = qu.id WHERE qrs.submitted_at IS NOT NULL) TO 'PATH_TO_EXPORT_FILE' WITH (FORMAT csv, HEADER true);
78

0 commit comments

Comments
 (0)