Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有三个数据库表字段。并想相应地分配一个序列号。
第一个字段是percentage, 10_percentage, date_of_birth。现在,如果值匹配,percentage则必须在百分比阶段的冲突记录之间进行最短或更早的比较10_percentage,即使冲突仍然存在,10_percentage也date_of_birth必须检查。我被困住了,找不到办法做到这一点。
percentage
10_percentage
date_of_birth
我这就是你要找的?
SET @rank=0; SELECT @rank:=@rank+1 AS rank, percentage, 10_percentage, date_of_birth FROM table ORDER BY percentage, 10_percentage, date_of_birth;
这个链接解释了mysql中的排名。这表明您在排序中使用了多个列