>>sql 님께서 쓰시길<<
:: sql 문에서요
::
:: select * From totalrank
:: where total=?
::
:: 에서 where 절에 어떻게 써야 total 이라는 컬럼에서 값이 상위 3% 안에 드는
::
:: 것만 뽑을 수 있을까요?
이렇게 하면 될것 같군요.
select *
from (select * from total order by total desc )
where rownum < ( select (count(1)/100)*3 cnt from totalrank )
|