Still not sure how to do it. Tried "TRACE inblock, outblock from (select bitand(a.sentddec, b.sentddec) as res from chunks10000 a, chunks10000 b where a.chunkid=b.chunkid AND  a.sentid<b.sentid);" But I guess I am doing something wrong.