DB2如何在一个表中取随机的N条记录啊
就是相当与sql server的select top 10 * from tablename order by newid() 或者oracle的 SQL codeselect *from (select *from t order by dbms_random.value) where rownum<10;
就是相当与sql server的select top 10 * from tablename order by newid() 或者oracle的 SQL codeselect *from (select *from t order by dbms_random.value) where rownum<10;
答案:select * from tablename order by rand() fetch first n rows only;