what are the three most frequently ordered medications until 2 years ago?
select t1.drug from ( select prescriptions.drug, dense_rank() over ( order by count(*) desc ) as c1 from prescriptions where datetime(prescriptions.startdate) <= datetime(current_time,'-2 year') group by prescriptions.drug ) as t1 where t1.c1 <= 3