Home >Database >Mysql Tutorial >从数据库中随机抽N条记录_MySQL

从数据库中随机抽N条记录_MySQL

WBOY
WBOYOriginal
2016-06-01 14:05:40915browse

Access:
select top n * from table order by rnd(id)'id为数据库的自动编号字段

Sql Server:
select top n * from table order by newid()

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn