ebmdatalab / prescribing-queries

Documentation about common queries against the prescribing dataset
GNU General Public License v3.0
3 stars 3 forks source link

Modality Practice Prescribing #51

Closed lmfrench closed 7 years ago

lmfrench commented 7 years ago

User requested 3 years all prescribing for practices in Modality Partnership

lmfrench commented 7 years ago
SELECT  
FORMAT_DATETIME('%Y-%m',DATETIME(presc.month)) AS month,
practice AS code,
prac.name AS name,
bnf_code,
bnf_name,
items,
actual_cost

FROM ebmdatalab.hscic.normalised_prescribing_standard as presc

LEFT JOIN ebmdatalab.hscic.practices AS prac
ON presc.practice=prac.code

WHERE
practice IN ('B82020','B82028','B83021','B83023','B83027','B83033','B83061','B81021','B81027','B81048',
'B81049','B81053','B81056','B81072','M85124','M85002','M85002','M85002','M85010','M85069','M85072','M85085',
'M85133','M85178','M85611','M88002','M88002','Y01680','M91028','M91616','M91643','M91660','K81022','K81638',
'M85016','M85016','M85749','M85786')
AND
month >="2014-06-01"

ORDER BY
month,
name
lmfrench commented 7 years ago

Sent (not through doorbell due to file size)