---
title: "mysql 从查询结果中随机取几条数据"
author: "pure"
date: "2010-03-01T13:06:00Z"
tags: []
categories: ["数据库"]
slug: "mysql"
draft: false
lastmod: "2010-03-01T13:06:00Z"
id: 604917
url: "https://pure.iteye.com/blog/604917"
---

select id,src_id,qq_nick,nick from small_user_5.player_50 where create_time > UNIX_TIMESTAMP('2010-01-18') and create_time < UNIX_TIMESTAMP('2010-02-01') and guideStep=100 ORDER BY<span style="color:red"> rand()</span> limit 2;