ThumbsPlus
All forums => ThumbsPlus v10 Questions => Topic started by: jaybird23238 on 2016-10-09 14:24:37
-
I need that ability to to search for files without a particular keyword, and it needs to tie in with an advance search.
Example:
File name mask: pet*.*
keyword not "dog"
Also need this to pair with an advance search and keyword not "dog"
-
1) In human-readable format:
----------------------------
tn.idthumb not in (
select distinct idthumb
from thumbnailkeyword
where thumbnailkeyword.idkeyword = (
select idkeyword
from keyword
where keyword = 'dog'
)
)
2) As a single long line, which should remain intact in the 'Found Files' results list, so that the query can be re-used later on:
----------------------------------------------------------------------
tn.idthumb not in (select distinct idthumb from thumbnailkeyword where
thumbnailkeyword.idkeyword = (select idkeyword from keyword where
keyword = 'dog'))
-
> 1) In human-readable format:
> ----------------------------
>
> tn.idthumb not in (
> select distinct idthumb
> from thumbnailkeyword
> where thumbnailkeyword.idkeyword = (
> select idkeyword
> from keyword
> where keyword = 'dog'
> )
> )
>
>
> 2) As a single long line, which should remain intact in the 'Found Files' results list, so that the query can be re-used later on:
> ----------------------------------------------------------------------
>
> tn.idthumb not in (select distinct idthumb from thumbnailkeyword where
> thumbnailkeyword.idkeyword = (select idkeyword from keyword where
> keyword = 'dog'))
How can I modify this to return all thumbnails that have no keywords at all. (keyword - "")
-
> How can I modify this to return all thumbnails that have no keywords at all.
Try either of these queries:
tn.idthumb not in (select distinct idThumb from ThumbnailKeyword)
not exists (select idKeyword from ThumbnailKeyword where ThumbnailKeyword.idThumb = tn.idThumb)
not exists (select idthumb from thumbnailkeyword tk inner join keyword kw on tk.idkeyword = kw.idkeyword where kw.keyword = 'KEYWORD' and tk.idthumb = tn.idthumb)
Source: www.cerious.com/faq_sql.shtml