我可以在 Where 里面做一个 if 吗?或仅当字段不为空时才允许我进行检查的东西(路径=空)
SELECT
IF(path IS NOT NULL, concat("/uploads/attachments/",path, "/thumbnails/" , nome), "/uploads/attachments/default/thumbnails/avatar.png") as avatar_mittente
FROM prof_foto
WHERE profilo_id = 15
-- only if path != "/uploads/attachments/default/thumbnails/avatar.png"
AND foto_eliminata = 0 AND foto_profilo = 1