Edit SQL request about tag fetching