select code from othertable where year = ? and state in (select state from mytable where city = ?)