count the number of patients who stayed until 1 year ago in ward 48.
select count( distinct admissions.subject_id ) from admissions where admissions.hadm_id in ( select transfers.hadm_id from transfers where transfers.wardid = 48 and datetime(transfers.intime) <= datetime(current_time,'-1 year') )