Salve amici, non riesco proprio a capire dove sia l'errore di questa query:
codice:
SELECT COM_ID, SUM(QU) AS TOT, SUM(PREZZO) AS PREZZO, TIPO FROM [SELECT (PREZZO*SUM(QU)) AS PREZZO, SUM(QU) AS QU, COM_ID, VOCE, quinto_menu_day.TIPO FROM quinto_ordine JOIN quinto_menu_day ON quinto_ordine.VOCE = quinto_menu_day.PIATTO WHERE quinto_ordine.COM_ID = '24' GROUP BY VOCE ORDER BY ORDINE] AS MAIN GROUP BY TIPO
Se faccio la sola select interna, mi restituisce correttamente i valori..... se faccio la select della select (anche mettendo SELECT * FROM) mi da il seguente errore:
codice:
#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 (PREZZO*SUM(QU)) AS PREZZO, SUM(QU) AS QU, COM_ID, VOCE
Cosa sbaglio?