sahel Posted July 11, 2008 Share Posted July 11, 2008 I have a set of records that i select randomly...i now have a situation where i have to prioritize some records. I want to make the selection to be able to prioritize the record order, i want high priority records to be shown on top based on a 0-100 (percent) priority. How can this be done?? Let me know if you have any questions. Talker. Quote Link to comment Share on other sites More sharing options...
sahel Posted July 11, 2008 Author Share Posted July 11, 2008 Here is what i have come up with.. just a thought, need your professional advice. I can add a priority column and specify the % of priority. Table data would be like: id--value--priority 1--a--0 2--b--0 3--c--25 4--d--25 5--e--100 6--f--100 7--g--100 ..and doing a select ordered by priority would give me.. id--value--priority 5--e--100 6--f--100 7--g--100 3--c--25 4--d--25 1--a--0 2--b--0 ... correct? i hope so. There is only one thing that i want added.. i want them randomized within the priority. so that the three 100% records come up randomized, the 2 25% ones randomize and the 0% randomize too.. How can that be done? Quote Link to comment Share on other sites More sharing options...
sahel Posted July 11, 2008 Author Share Posted July 11, 2008 Well i found out. wast that hard after all. used order by priority DESC, RAND() Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.