Changes between Version 12 and Version 13 of OnyxDatabaseReporting


Ignore:
Timestamp:
02/25/13 15:47:57 (12 years ago)
Author:
Nick Holden
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OnyxDatabaseReporting

    v12 v13  
    204204# To find duplicates enrollment_id entries:
    205205
    206 mysql -h briccsdb -u auditor -pg3s4t6 briccs -e "SELECT * FROM participant ptone WHERE EXISTS (SELECT 1 FROM participant pttwo WHERE pttwo.enrollment_id = ptone.enrollment_id LIMIT 1, 1 );"
     206mysql -h briccsdb -u auditor -p briccs -e "SELECT * FROM participant ptone WHERE EXISTS (SELECT 1 FROM participant pttwo WHERE pttwo.enrollment_id = ptone.enrollment_id LIMIT 1, 1 );"
    207207
    208208
    209209# So to exclude duplicates and NULL BPt numbers:
    210210
    211 mysql -h briccsdb -u auditor -pg3s4t6 briccs -e "SELECT * FROM participant ptone WHERE NOT EXISTS (SELECT 1 FROM participant pttwo WHERE pttwo.enrollment_id = ptone.enrollment_id LIMIT 1, 1 ) AND barcode is not null order by enrollment_id;"
     211mysql -h briccsdb -u auditor -p briccs -e "SELECT * FROM participant ptone WHERE NOT EXISTS (SELECT 1 FROM participant pttwo WHERE pttwo.enrollment_id = ptone.enrollment_id LIMIT 1, 1 ) AND barcode is not null order by enrollment_id;"
    212212
    213213# To exclude duplicates, nulls and cancelled interviews and list barcodes (BPt numbers) and enrollment dates:
    214214
    215 mysql -h briccsdb -u auditor -pg3s4t6 briccs -e "SELECT barcode, start_date, status
     215mysql -h briccsdb -u auditor -p briccs -e "SELECT barcode, start_date, status
    216216FROM participant ptone, interview WHERE NOT EXISTS (SELECT 1 FROM participant pttwo WHERE pttwo.enrollment_id = ptone.enrollment_id LIMIT 1, 1 ) AND barcode is not null AND status <> 'CANCELLED'
    217217AND ptone.id = interview.participant_id order by start_date;" > briccs_enrollment_to_date.txt
     
    219219# To get a count of the above:
    220220
    221 mysql -h briccsdb -u auditor -pg3s4t6 briccs -e "SELECT count(*)
     221mysql -h briccsdb -u auditor -p briccs -e "SELECT count(*)
    222222FROM participant ptone, interview WHERE NOT EXISTS (SELECT 1 FROM participant pttwo WHERE pttwo.enrollment_id = ptone.enrollment_id LIMIT 1, 1 ) AND barcode is not null AND status <> 'CANCELLED'
    223223AND ptone.id = interview.participant_id order by start_date;"
    224224
    225