laminuscula

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 ') GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26' at line 33

SELECT p.id,p.fotos_groups_id,pd.durada,pd.link_comprar, pd.destacat,p.grouped, p.price, p.weight, pd.name,pd.subtitol, pd.desc_short, pd.description, pd.tecnical, pd.box_content, p.image, p.video,p.video2, p.status, pd.download,pd.download_title,pd.download2,pd.download2_title, p.espais_id, p.web_companyia,pd.llengua,pd.activitats_relacionades,p.companyia,p.autor, p.disponibility_id, p.available, p.tax_class_id, p.entered,pd.observacions,p.id_edicions,p.amagar_fitxa,p.id_tipus_producte, ed.titol as titol_edicio, MIN(IF(pf.data < NOW() OR pf.id IS NULL, NULL, pf.data)) as data_propera_funcio, MIN(pf.data) as data_primera_funcio, MAX(pf.data) as data_ultima_funcio, COUNT(pf.id) as total_funcions_actives -- MAX(pf.data) as data_ultima_funcio_total, -- COUNT(pf.id) as total_funcions -- GROUP_CONCAT(DISTINCT IF(pf.status = 0 AND pf.data < NOW(), NULL, pf.status) ) as estats_funcions, -- GROUP_CONCAT(DISTINCT IF(pf.status = 0 OR pf.te_hora = 0, NULL, DATE_FORMAT(pf.data,'%H:%i'))) as hores_funcions, -- GROUP_CONCAT(DISTINCT c.id) as ids_categories, -- GROUP_CONCAT(DISTINCT CONCAT(cd.categories_id, ':', cd.name)) as categories, -- GROUP_CONCAT(DISTINCT ld_espais.titol SEPARATOR ', ') as noms_espais, -- GROUP_CONCAT(DISTINCT CONCAT(' espai_',ld_espais.llistats_id)) as class_espais FROM products p LEFT JOIN products_description pd on (p.id = pd.products_id and pd.language_id = '1') LEFT JOIN products_to_categories p2c on (p.id = p2c.products_id) LEFT JOIN categories c on (c.id = p2c.categories_id) LEFT JOIN categories_description cd on (cd.categories_id = c.id and cd.language_id = '1') LEFT JOIN edicions_description ed on (ed.edicions_id = p.id_edicions and ed.language_id = '1') LEFT JOIN products_funcions pf on (pf.id_espectacle = p.id and pf.status != 0) LEFT JOIN llistats_description ld_espais on (ld_espais.llistats_id = pf.espais_id and ld_espais.language_id = '1') -- LEFT JOIN categories c_aux on (c_aux.id = p2c_aux.categories_id) -- LEFT JOIN products_to_categories p2c_aux on (p.id = p2c_aux.products_id) -- LEFT JOIN products_funcions pf_aux on (pf_aux.id_espectacle = p.id) -- LEFT JOIN llistats_description ld_espais_aux on (ld_espais_aux.llistats_id = pf_aux.espais_id and pf_aux.status != 0 and ld_espais_aux.language_id = '1') WHERE p.status = '1' AND p.id_tipus_producte = 1 AND c.id <> 15 AND id_edicions = 1 AND p.id IN () GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37 HAVING (data_propera_funcio is null AND total_funcions_actives > 0) OR (data_propera_funcio <= data_ultima_funcio OR (total_funcions_actives = 0)) ORDER BY FIELD(p.id,)

Notícies