SELECT DISTINCT * FROM `anuncios` WHERE `id_formato_anuncio` = (SELECT id FROM anuncios_formatos WHERE slug='320x50') AND id NOT IN ('') AND ativo=1 ORDER BY rand() LIMIT 1