ruilog
Notebook
Blog
About
Content Explore
1.10 随机返回 n 条记录
Published : 2008-11-13
Categories :
Cookbook
Tags :
SQL
DB2
MySQL
Oracle
PostgreSQL
Database
MSSQL
RAND
RANDOM
dbms_random
newid
Q: 从表中随机返回 n 条记录,每次执行返回不同的结果集
A: 使用DBMS内置函数生成随机数值,在 ORDER BY 中使用该函数随机排序
DB2 ( 使用 RAND 内置函数 )
SELECT ...
1
Categories
All
Database and Storage
NoSQL
Storage
Graph
SQL
Research and Development
Algorithms
NLP
Machine Learning
Information Retrieval
Intelligent Transport System
Coding
Message Queue
Big data
Security
Tips
Network
OS
Design
Archives
Others
Hardware
Web Design
Software
Web Develop