View Single Post
Old 01-04-2019, 11:01 PM   #11
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
See the attached image for a yes/no column easily updated by an EM program manually and/or automatically at Startup if a particular book has any Entity Type with a matching Entity Value already created as an Entity.

#18 is the yes/no CC table.

The code is just for Author, but checking for all Entity Types that exist in the the _entities table is trivial.

Code:
UPDATE custom_column_18 SET value = 1
WHERE custom_column_18.book IN
(SELECT book FROM books_authors_link WHERE author IN
(SELECT id FROM authors WHERE authors.name IN (SELECT value FROM _entities WHERE type = 'Author')));

UPDATE custom_column_18 SET value = 0
WHERE custom_column_18.book NOT IN
(SELECT book FROM books_authors_link WHERE author IN
(SELECT id FROM authors WHERE authors.name IN (SELECT value FROM _entities WHERE type = 'Author')))
The only decision that each user would need to make is whether they want a single yes/no table for each Entity Type, or just one per book if there is any Entity Match among any of each book's metadata.


DaltonST
Attached Thumbnails
Click image for larger version

Name:	IsEntity_yes_no_custom_column.jpg
Views:	608
Size:	134.3 KB
ID:	168841  
DaltonST is offline   Reply With Quote