ARCHIVO: /var/www/html/templates/paquetes_ficha_2012.php
LINEA: 44

SELECT notas_variantes.*, notas_variantes.id as idnotavar,
IF(notas_variantes.hoteles<>'',notas_variantes.hoteles,notas_variantes.id) AS grupo_hoteles,
IF(notas_variantes.hoteles<>'',1,0) AS solo_hoteles,
hoteles as hoteles_g,
COUNT(notas_variantes.nota) AS ncantidad,
(select t2 from notas_variantes WHERE notas_variantes.nota = AND vigencia_fin>=NOW() and hoteles = hoteles_g order by vigencia_fin asc,t2 asc limit 1) AS minimo
FROM notas_variantes
WHERE
nota= AND
vigencia_fin>=NOW()
GROUP BY grupo_hoteles
ORDER BY
minimo,
vigencia_ini
ASC


ERROR:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND vigencia_fin>=NOW() and hoteles = hoteles_g order by vigencia_fin asc,t2 ...' at line 6