Sunday 15 February 2015

php - mysql order by value, merging columns -


I have a database of accounts, each account has a member of the rank (member, hidden will be used here)

There is no issue to the extent of the query, so I will only use the English version which I am trying to achieve.

SELECT * FROM accounts ... DESC

This clearly does not work, but basically if the account rank is hidden, then He should be considered if it was a member rank (hence it is hidden).

Is this possible?

This is what you should do that you have a simple CASE ;

 , in the order from order when the rank = 'hidden' then 'member' ELSE rank END DISE   

.

No comments:

Post a Comment