Skip to content

Instantly share code, notes, and snippets.

Avatar
😊

Andrew McGill arm5077

😊
View GitHub Profile
@arm5077
arm5077 / doctors.sql
Created Apr 23, 2014
Medicare doctor charge database query
View doctors.sql
SELECT medicare.*,
peerAverage.average AS charge_average,
( medicare.average_submitted_chrg_amt - peerAverage.average ) /
peerAverage.average * 100 AS difference_from_average,
totalAverage.total_difference_average
FROM medicare
JOIN (SELECT Avg(average_submitted_chrg_amt) AS average,
hcpcs_code,
place_of_service
FROM medicare