show me the three most frequently prescribed drugs for patients 40s until 4 years ago?
select t1.drug from ( select prescriptions.drug, dense_rank() over ( order by count(*) desc ) as c1 from prescriptions where prescriptions.hadm_id in ( select admissions.hadm_id from admissions where admissions.age between 40 and 49 ) and datetime(prescriptions.startdate) <= datetime(current_time,'-4 year') group by prescriptions.drug ) as t1 where t1.c1 <= 3