>Select distinct(a.title),b.docindex_i from ocrdata a,docudeck b ; >where a.tiffile = b.file_name ; >and a.ocdata like "%schedule%" ; >order by a.id into cursor lcsource >###################################################################The WHERE condition will be applied after the JOIN, so it may be that the records bubbling up with the DISTINCT clause are not the ones matching your WHERE.