Story/oracle
mysql 에서 order by rand() 와 같은 기능
Stdio
2009. 1. 19. 14:18
반응형
ex)
select
no_goods
from
(
select
no_goods
from
tm_goods a ,
tm_codes b
where
a.gb_goods = b.cd_code
and b.ds_code = '001'
and a.gb_goods = '001'
order by dbms_random.value
)
where
rownum = 1
no_goods
from
(
select
no_goods
from
tm_goods a ,
tm_codes b
where
a.gb_goods = b.cd_code
and b.ds_code = '001'
and a.gb_goods = '001'
order by dbms_random.value
)
where
rownum = 1
반응형