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 -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -