Não dá para fazer a consulta: SELECT DISTINCT tng_media.mediaID, albumlinkID, tng_media.description, tng_media.notes, thumbpath, alwayson, usecollfolder, mediatypeID, path, form, abspath, newwindow FROM (tng_albumlinks, tng_media) LEFT JOIN tng_medialinks ON tng_media.mediaID = tng_medialinks.mediaID WHERE albumID = "2" AND tng_albumlinks.mediaID = tng_media.mediaID AND (tng_media.gedcom = "TatieDickson" || tng_media.gedcom = "") ORDER BY tng_albumlinks.ordernum, description LIMIT 400