Foros de debate Categorías Foros

Los diez mejores sitios para visitar en Madrid

Calendario
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT dq.destacar, dq.discotecas_quedadas_tipo_id as tipo,dqt.orden,dq.precio_m' at line 1

(select * from SELECT dq.destacar, dq.discotecas_quedadas_tipo_id as tipo,dqt.orden,dq.precio_min as precio,dq.hashtags,dq.publicar,dq.dia_hora_fin, dq.customers_id ,dq.dia_hora , titulo, dq.descripcion,dq.quedada_id as id , d.discotecas_id , d.customers_id as discotecas_administrador_id,case when dq.foto is null then d.logotipo else dq.foto end as foto, d.nombre as nombre,case when d.discotecas_id is null then concat(dq.direccion_lugar) else concat(d.direccion,', ' ,d.poblacion) end as direccion , case when IFNULL(lat,0)<> 0 then (acos(sin(radians(40.3956166)) * sin(radians(lat)) + cos(radians(40.3956166)) * cos(radians(lat)) * cos(radians(-3.699108) - radians(lng))) * 6378) else 1000000 end AS distance,dq.tickets_url,dq.estado as estado_evento, dq.permitir_agregar_amigos,dq.seguidores_id ,dq.ranking_global ,gm.id_grupo, gm.nombre AS nombre_grupo, gm.comentario_automatico from dicotecas_quedadas dq join discotecas_quedadas_tipo dqt on dqt.discotecas_quedadas_tipo_id= dq.discotecas_quedadas_tipo_id LEFT JOIN dicotecas_quedadas_grupomusical dgm ON dgm.quedada_id = dq.quedada_id LEFT JOIN GrupoMusical gm ON gm.id_grupo = dgm.id_grupo left join discotecas d on dq.discotecas_id=d.discotecas_id where dq.estado in (0,-1) and (((date_format(dq.dia_hora, '%Y-%m-%d') between '2017-01-01' and '2017-01-31' || date_format(dq.dia_hora_fin, '%Y-%m-%d') between '2017-01-01' and '2017-01-31' )) || '2017-01-01' between date_format(dq.dia_hora, '%Y-%m-%d') and date_format(dq.dia_hora_fin, '%Y-%m-%d')) and (publicar=1 or dq.quedada_id in (-1)) AA where (AA.distance <=500 || distance=1000000)) limit 0,1500

[TEP STOP]