select
            @preciomin := (ifnull(preciodesde_over(alojamiento.aloj_id,2,'2','',18,'2024-04-04','2024-04-05',0),0)) as preciodesde,
            @preciomin > 0 tieneprecio,
            case
                when alojamiento.aloj_cat_id <= 5 then alojamiento.nombre
            else
                concat(aloj_categoria_txt.descr,' ',alojamiento.nombre)
            end nombre,
            alojamiento.nombre nombrereal,
            aloj_categoria.aloj_cat_id,
            case when alojamiento.online = 1 then freesales.clases else '' end clasesfree,
            alojamiento.puntaje votacion,
            aloj_categoria.orden,
            (alojamiento.online + freesales.clases <> '') recomendados,
            alojamiento.valoracion_id,
            alojamiento.aloj_id,
            alojamiento_txt.descripcion_corta descripcion,
            destinos_txt.descr destino_txt,
            ubicacion_txt.descr ubicacion_txt,
            alojamiento.grado_longitud lat,
            alojamiento.grado_latitud lon,
            alojamiento.drelease,
            aloj_moneda.moneda_id,
            alojamiento.comision,
            descuento.descuento_tc,
            descuento.descuento_trans,
            descuento.tipo,
            (@precio - (@precio*alojamiento.comision/100)) as base,
            (@precio*alojamiento.comision/100) as com
        from
           alojamiento
           left join aloj_descuentos_free descuento on
                descuento.aloj_id = alojamiento.aloj_id and
                now() between descuento.inicio and descuento.fin and
                descuento.procedencia_id = 18
            left join (
                select
                   aloj_id,
                   ifnull(group_concat(habitacion_clase_id),'') clases
                from
                (
                   select
                  habitacion_clase_id,
                  aloj_id
                   from
                  aloj_hab_bloqueos_contadores
                   where
                  noche between '2024-04-04' and '2024-04-04' and
                  cantidad >= 1
                   group by
                  aloj_id, habitacion_clase_id
                   having
                  count(*) = 1
                ) disponibles
                group by aloj_id
            ) freesales on alojamiento.aloj_id = freesales.aloj_id,
           alojamiento_txt,
           destinos_txt,
           ubicacion_txt,
           aloj_categoria,
           aloj_categoria_txt,
           aloj_moneda

        where
           alojamiento_txt.aloj_id = alojamiento.aloj_id and
           alojamiento_txt.idiomas_id = 1 and
           destinos_txt.destino_id = alojamiento.destino_id and
           destinos_txt.idiomas_id = 1 and
           ubicacion_txt.ubicacion_id = alojamiento.ubicacion_id and
           ubicacion_txt.idiomas_id = 1 and
           alojamiento.aloj_id in (14,22,31,32,45,49,51,52,55,67,98,118,119,167,183,191,197,201,209,211,221,249,252,253,254,263,291,293,302,323,329,332,333,334,343,344,349,389,390,395,421,434,437,442,444,524) and
           aloj_categoria.aloj_cat_id = alojamiento.aloj_cat_id and
           aloj_categoria_txt.aloj_cat_id = alojamiento.aloj_cat_id and
           aloj_categoria_txt.idiomas_id = 1 and
           ((18 = 18) or (alojamiento.bueno_turista_intl = 1 and 18 = 2)) and
           aloj_moneda.aloj_id = alojamiento.aloj_id and
           aloj_moneda.procedencia_pasajero_id = 18

        order by
        2 desc, 9 desc, alojamiento.valoracion_id desc, 1 asc
        LIMIT
        0, 200
    
Error en linea 613: Result consisted of more than one row