How to enter a sort position into a database
Posted: Mon Aug 15, 2011 5:30 am
I would like to do the following:
Sort a database table based on the value of one of the items in the table (no problem), then update another item in the table with the position of the row in the sort.
So, say, it was a football league table:
Sort by Points DESC, Goal Diff DESC to come up with a league table order, then write back into the database (say to a variable called POSITION) the position of the club in that table.
I have looked, but I have not found how to do this.
Can someone help please?
Sort a database table based on the value of one of the items in the table (no problem), then update another item in the table with the position of the row in the sort.
So, say, it was a football league table:
Sort by Points DESC, Goal Diff DESC to come up with a league table order, then write back into the database (say to a variable called POSITION) the position of the club in that table.
I have looked, but I have not found how to do this.
Can someone help please?