instruction: how many patients were admitted to the hospital before the year 2165 with an item id 50990?
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2165" AND lab.itemid = "50990"