NOT LIKE not working on comparison to a column
- by rodling
Data is fairly large and takes few minutes to run it every time, so its taking a lot of time debugging this problem. When I run like concat('%',T.item,'%') on smaller data it seems to identify items properly. However, when I run it on the main DB (the code shown), it still shows many(maybe even all) of the exceptions.
EDIT:
it seems when i add NOT it stops identifying items
select distinct T.comment
from (select comment, source, item from data, non_informative where ticker != "O" and source != 7 and source != 6) as T
where T.comment not like concat('%',T.item,'%')
order by T.comment;
comment and source are in data, item is in non_informative
Some items from T.item:
'Stock Analysis -', '#InsideTrades', 'IIROC Trade'
Example comment which should be removed
'#InsideTrades #4 | MACNAB CRAIG (Director,Officer,Chief Executive
Officer): Filed Form 4 for $NNN (NATIONAL RETA'
Can't seem to figure out it why shows all the items