select type, data from テーブル where year=2017 and month=1 and day=1 and (type='a' or type ='b');
じゃダメなのか?