HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/AppData/Local/Microsoft/OneDrive/26.168.0830.0006/WebAssets/sql/photo_path_lookup.sql
-- @query photo_path_lookup
-- @db thumbnailCache 9.0
-- @db localContent 32.0
-- @param photoId INT
SELECT COALESCE(
  (SELECT h.ItemPath FROM localContent.ItemHierarchyView h
   WHERE h.FileSystemID = tm.fileSystemId LIMIT 1),
  (SELECT h.ItemPath FROM localContent.ItemHierarchyView h
   WHERE h.DriveItemID = tm.driveItemId LIMIT 1)
)
FROM thumbnailCache.thumbnail_metadata tm
WHERE tm.id = ?photoId
LIMIT 1