instruction: what was the three most frequently taken lab test until 2 years ago for patients with an age 40s?
response: SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT t1.itemid FROM (SELECT labevents.itemid, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-2 year') GROUP BY labevents.itemid) AS t1 WHERE t1.c1 <= 3)