思路: 先將取出的值隨機排序,然後在隨機排序的每次取第一條的結果 舉例如下: select * from(select t.code fromTBIZOPS_PROVINCE t ORDER BY DBMS_RANDOM.RANDOM())where rownum < 2;select * from ...
思路:
先將取出的值隨機排序,然後在隨機排序的每次取第一條的結果
舉例如下:
select * from(select t.code fromTBIZOPS_PROVINCE t ORDER BY DBMS_RANDOM.RANDOM())where rownum < 2;
select * from (select t.code from TBIZOPS_CITY t wheret.province_id = '13' ORDER BY DBMS_RANDOM.RANDOM()) where rownum< 2 ;
select * from (select t.code from TBIZOPS_County t wheret.province_id = '13' and t.city_id = '1304'ORDER BYDBMS_RANDOM.RANDOM()) where rownum < 2 ;