SELECT tags.id, tags.nombre, IFNULL((SELECT 1 FROM relaciones WHERE id_tags=tags.id LIMIT 1),0) as tiene_video FROM tags