Changes between Version 5 and Version 6 of OnyxDatabaseReporting


Ignore:
Timestamp:
01/18/12 12:49:41 (13 years ago)
Author:
Nick Holden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OnyxDatabaseReporting

    v5 v6  
    118118;
    119119
     120Using UNION to produce a list of S numbers and DOBs for participants who are either study specific recruits or have a specific primary or secondary diagnosis:
     121
     122mysql -h briccsdb -u auditor -p briccs -e "
     123SELECT barcode as 'Participant', birth_date as 'DOB'
     124FROM participant, questionnaire_participant, question_answer, category_answer
     125WHERE participant.id = questionnaire_participant.participant_id
     126AND question_answer.questionnaire_participant_id = questionnaire_participant.id
     127AND ( question_answer.question_name = 'epi_pridiag' OR question_answer.question_name = 'epi_secdiag' )
     128AND category_answer.question_answer_id = question_answer.id
     129AND category_answer.category_name = 'Aortic_Stenosis'
     130UNION
     131SELECT barcode as 'Participant', birth_date as 'DOB'
     132FROM participant, questionnaire_participant, question_answer, category_answer
     133WHERE participant.id = questionnaire_participant.participant_id
     134AND question_answer.questionnaire_participant_id = questionnaire_participant.id
     135AND question_answer.question_name = 'epi_type'
     136AND category_answer.question_answer_id = question_answer.id
     137AND category_answer.category_name = 'Study_specific'
     138;
     139 " > mysql-output.txt