Mysql Subquery to reverse order -


i have code , not working. want reverse order after make query latest comments.

select *  from(      select users.id, users.nome, users.email,users.foto, comments.content     users, comments      comments.posts_id=? , comments.users_id=users.id     order comments.id desc limit 5)  dummy  order comments.timecomment asc 

looks need give outer query (cid) sort on, you're doing;

select *  (select users.id, users.nome, users.email,users.foto,               comments.content, comments.id cid       users, comments        comments.posts_id=1 , comments.users_id=users.id       order comments.id desc limit 5) dummy order cid asc 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -