开发者

Query for Updates in database when One of the Column is affected

I have a database with column as points,ranking and some others. When I change the points in t开发者_开发问答he database is it possible to rank all the records based on updated data. I am not entering ranks it should be calculated every time when I change the Points column.


I'd suggest do not do any calculations in the DB, it should be done at the Sever. You may do (on MYSQL):

SELECT points FROM TABLE ORDER BY points DESC LIMIT 50;

Then on the server you have a descending order list of points with each you can associate a Rank.

DB is best kept as away as possible from calculations.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜