I don't think like works with a subquery as its righthand operand. Or at least 
not the way you're expecting it to. It's probably only using the very first 
result of the subquery for all the comparisons. If you're looking for an exact 
match then what Simon suggested is the way to go. If you're going to have 
actual match patterns in SkipRemed then you're going to need a join in there.



On 19 Apr 2017, at 8:12pm, Stephen Chrzanowski <pontia...@gmail.com> wrote:

> The query I've been messing with is this:
> 
> *select distinct ExtIP, IntIP, Service,Remediation from PMEScan where
> Remediation not like (select distinct Skip from SkipRemed) order by
> upper(Desc),upper(Service)*

I would have expected

select distinct ExtIP, IntIP, Service,Remediation from PMEScan where
Remediation NOT IN (SELECT Skip from SkipRemed) order by
upper(Desc),upper(Service)

> I don't get the results I want, unless I use the actual full text of the
> Remediation text.  I've changed Skip to '%'||Skip||'%' in the subquery but
> that doesn't get me the results I want either.

What are the affinities of the Remediation and Skip columns ?

What is it doing ?  Skipping ones you want to include, or including ones you 
want to skip ?  Both ?  Can you give examples of the Remediation and Skip 
values ?

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to