Home > Database > Mysql Tutorial > sql 随机取得数据

sql 随机取得数据

WBOY
Release: 2016-06-07 17:46:35
Original
837 people have browsed it

以前没注意到随机抽取数据,下面我来说说我的经验.

mssql :

select * from tablename order by newid() desc

在mssql取得随便数据的函数是newid

mysql中:

select * from tablename order by rand() desc

在mysql用来取得随便数据的函数是rand了.

就这么简单,

申明:转载请注来处.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template