select * from table_a where charindex('a',id)>0 or charindex('b',id)>0 table_a 表中 id字段中含有"a"或者"b"的记录.