0

フィールドのランクを実装するための最良の方法を見つけようとしています

4

1 に答える 1

0

あなたの質問はあまり明確ではありません。

DENSE_RANK 関数を試すことができます SQL Server: 'http://msdn.microsoft.com/en-us/library/ms173825.aspx' Oracle: http://www.techonthenet.com/oracle/functions/dense_rank.php

mysql:

set @sno:=0;
set @names:='';
select @sno:=case when @names=names then @sno else @sno+1 end as sno,@names:=names as names from test
order by names;
于 2012-07-27T09:23:55.250 に答える