请问!

请教!!!!!有这样一个表票号序号档案号00011a00012a00013a00011b00021a00031a00032a00041a00041b想查出档案

请教!!!!!
有这样一个表
票号                 序号         档案号
0001                   1                   a
0001                   2                   a
0001                   3                   a
0001                   1                   b
0002                   1                   a
0003                   1                   a
0003                   2                   a
0004                   1                   a
0004                   1                   b
想查出档案号中一起出现过AB的票号

[解决办法]
select distinct 票号 from 表 t where t.档案号= 'a ' and exists(select 1 from 表 where 票号=t.票号 and 档案号= 'b ')