This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this questioneach one of them has the option to be stick at the first of the category , now the field name of the stick is n_stick it's 1/0 value , and also each new post has a time , now i need to order the news according to which is it stick new or not, and second to it's time , which mean that all the sticky news show at first ordered by the newest time and after them the non-sticky news also ordered by the new开发者_JS百科est time , ALL of this in same Query , this is the problem .
I tried this but did not work :
SELECT * FROM news ORDER BY n_stick,n_time DESC
Also did tried this :
SELECT * FROM news ORDER BY n_stick DESC,n_time DESC
But also no solution , any help buddy's ?
thank you .
Your second query:
SELECT *
FROM news
ORDER BY
n_stick DESC, n_time DESC
should work.
精彩评论