【PostgreSQL】Select取得行号
select p1.name
, (select count(*)
from (
select *
from persons p2
where p2.age > p1.age
) as foo
) + 1 as rank
from persons p1
order by rank asc;
, (select count(*)
from (
select *
from persons p2
where p2.age > p1.age
) as foo
) + 1 as rank
from persons p1
order by rank asc;
| 本作品采用 知识共享署名-非商业性使用 2.5 中国大陆许可协议进行许可。 |
浙公网安备 33010602011771号