| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Users/SERVERWEB/AppData/Local/Microsoft/OneDrive/26.074.0420.0001/WebAssets/sql/ |
Upload File : |
-- @query people_list
-- People entity listing. Returns all recognized entities with their photo counts,
-- filtered to Gallery library, sorted by most-photographed first.
-- Used by: people.js, shell-people.js
-- @db media 11.0
--
-- @with photos_only
-- @end-with
SELECT
rel.entityId AS entity_id,
COUNT(DISTINCT rel.driveItemId) AS photo_count
FROM recognized_entity_lookup AS rel
JOIN media.media_properties AS cloud ON rel.driveItemId = cloud.driveItemId
JOIN media.media_libraries AS drive ON cloud.driveId = drive.driveId
WHERE cloud.isTombstoned = 0
AND drive.libraryType = 'Gallery'
AND cloud.takenDateTime IS NOT NULL
-- @with photos_only
AND cloud.photo IS NOT NULL
AND cloud.video IS NULL
-- @end-with
GROUP BY rel.entityId
ORDER BY photo_count DESC