View Single Post
Old 10-18-2017, 04:51 PM   #8
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Next in series

Quote:
Originally Posted by Ray99 View Post
I use the tag "_read" when I've finished reading a book. At any time I have many series on the go and I would like to be able to search for the first unread book in each of the series of which I have read at least one book.
This is an MCS feature that does what was requested above.


See the attached screenprint for an example.


Quote:
SELECT book AS unread, series AS unreadseries
FROM books_series_link
WHERE
(unread NOT IN (SELECT book FROM _mcs_tags_concatenate WHERE tagsconcat LIKE '%read%') )
AND
(unreadseries IN (SELECT series FROM books_series_link WHERE book IN (SELECT book FROM _mcs_tags_concatenate WHERE tagsconcat LIKE '%read%') ) )

GROUP BY unreadseries


"LIKE" ignores the case of the letters, but uses both _ and % as a wildcard. "_read" starts with an underscore, so as to avoid complications in my testing, I used "ReadAlready" instead.

Finally, table _mcs_tags_concatenate is an MCS Search Accelerator Table is automatically updated by MCS in most cases. However, if you make a lot of Tag changes and immediately want to run this MCS query, it might be a good idea to force a manual update of the MCS Search Accelerator Tables via the menu path MCS > Refresh MCS Search Accelerators. There are search accelerator tables for both Tags and Authors. The menu ToolTips mention Authors, but the same is true for Tags.



DaltonST
Attached Thumbnails
Click image for larger version

Name:	mcs_next_series_index_to_read_sql_query.jpg
Views:	398
Size:	507.7 KB
ID:	159538  
DaltonST is offline   Reply With Quote