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.
我有一张桌子domain,里面有name, alexarank, ind.
domain
name
alexarank
ind
我知道如何以默认顺序枚举所有行:
UPDATE domain SET ind = (SELECT @a := @a + 1 FROM (SELECT @a := 0) s);
请建议如何枚举它们按 alexarank 排序。
UPDATE domain SET ind = (SELECT @a := @a + 1 FROM (SELECT @a := 0) s) ORDER BY something;
如中所述:http ://dev.mysql.com/doc/refman/5.6/en/update.html