View Single Post
Old 09-03-2011, 10:41 AM  
michael.kickass
Too lazy to set a custom title
 
michael.kickass's Avatar
 
Join Date: Mar 2009
Posts: 11,039
Quote:
Originally Posted by camperjohn64 View Post
Let's say I have 10,000 videos, each video has a viewcount. To select them in order of viewcount:

SELECT * FROM videos ORDER BY viewcount;

[0] -> video A with 13,000 views
[1] -> video B with 12,824 views
[2] -> video C with 11,374 views
etc...
SELECT * FROM videos ORDER BY viewcount DESC;

Result:
[0] -> video A with 13,000 views
[1] -> video B with 12,824 views
[2] -> video C with 11,374 views


SELECT * FROM videos ORDER BY viewcount ASC;

Result:
[2] -> video C with 11,374 views
[1] -> video B with 12,824 views
[0] -> video A with 13,000 views
__________________
NICERATIOS - $30 PPS - 50% Rev Share - 5% WM Referral - High Converting Sites!
Any questions about your NICERATIOS account? Vanessa will take care of you: [email protected]

Looking to expand your business in general, maybe sell your sites? Contact me:
[email protected]
michael.kickass is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote