ho un problema a quanto pare abbastanza comune qui nel forum, mi dispiace quindi dover scrivere un altro post in merito ma non riesco a far funzionare la query
ecco la mia tabella con alcuni record:
post_id - post_autore - post_titolo - post_data_post - post_relativo_a - post_stanza
1 - 3 - 'titolo1' - 1189032376 - 2 - 1
2 - 3 - 'titolo2' - 1189032476 - 3 - 1
3 - 5 - 'titolo3' - 1189032485 - 2 - 2
4 - 3 - 'titolo4' - 1189032976 - 2 - 1
io vorrei estrarre le righe con la data massima per ogni stanza (le stanze le impongo io)
quindi la rgha con id 3 e 4
leggendo questa discussione:
http://forum.html.it/forum/showthrea...t=group+by+max
ho provato a scrivere questa query:
SELECT * FROM
(select concat(post_autore,post_stanza,post_titolo,post_id , post_relativo_a,max(post_data_post)) as datas from forum_post
group by post_id
HAVING `post_stanza` IN (1, 2)) as tab1
left join forum_post as tab2 ON tab1.datas = concat(tab2.post_id,tab2.datas)
ma ottengo questo errore:
Errore di sintassi nella query SQL vicino a 'SELECT concat( post_autore, post_stanza, post_titolo, post_id, post_relativo_a, ' linea 3
oltretutto questa query mi è poco chiara :master: