count the number of times patient 56490 until 177 months ago has been prescribed with sw.
select count(*) from prescriptions where prescriptions.hadm_id in ( select admissions.hadm_id from admissions where admissions.subject_id = 56490 ) and prescriptions.drug = 'sw' and datetime(prescriptions.startdate) <= datetime(current_time,'-177 month')