Keeping DB Table sorted using multi-field formula (Microsoft SQL)
- by user298167
Hello Everybody. I have a Job Table which has two interesting columns: Creation Date and Importance (high - 3, medium 2, low - 1). Job's priority calculated like this:
Priority = Importance * (time passed since creation). The problem is, Every time I would like to pick 200 jobs with highest priority, I dont want to resort the table. Is there a way to keep rows sorted?
I was also thinking about having three tables one for High, Medium and Low and then sort those by Creation Date.
Thanks