Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL query question

Status
Not open for further replies.

gizmicek

Programmer
Jun 25, 2003
107
CZ
Hi all,
users on my web site are divided into 2 categories - certified and uncertified users. My site also contains section "TOP list" where the best users (my site is related to the online RPG game) are listed. The thing is that I want to list the certified users before the uncertified ones(the further sorting is already done). In the MySQL dataabase I have the field named "certifydate" in the user table which contains unix timestamp of the date when the user was certified. So this field can be used to recognize certified users (uncertified have 0 in this field).

My query looks like this right now:
Code:
SELECT * FROM  `users` WHERE 1 ORDER BY `rank` DESC, `experience` DESC, `login`

I need to add something like this after the ORDER BY statement:
`certifydate`<>0 DESC

I don't have any experience about making queries containing statements which should be calculated before application but this seems to me like it could work.

Any suggestions?
 
My example mentioned above works fine, sorry for bothering
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top