title: MySQL Random Result Group By Order By
body: <p>How do i get a random result on <code>group by</code> group_id? </p>
  
  <p>its similar like this: <a href="https://stackoverflow.com/questions/32283955/random-order-for-group-of-rows-in-mysql">Random order for group of rows in mysql</a></p>
  
  <p>here is my fiddle: <a href="http://sqlfiddle.com/#!9/1c73d/3" rel="nofollow noreferrer">http://sqlfiddle.com/#!9/1c73d/3</a></p>
  
  <p>not sure why it always gives me the same result.</p>
  
  <pre><code>CREATE TABLE job
      (`job_id` int, `group_id` int, `user_id` int, `title` varchar(50), `description` varchar(55), `type` tinyint)
  ;
  
  INSERT INTO job
      (`job_id`, `group_id`, `user_id`, `title`, `description`,`type`)
  VALUES
      (1, 1, 100, 'Title 1', 'Text 1', 1),
      (2, 1, 100, 'Title 2', 'Text 2', 1),
      (3, 1, 200, 'Title 3', 'Text 3', 1),
      (4, 1, 200, 'Title 4', 'Text 4', 1),
      (5, 1, 300, 'Title 5', 'Text 5', 2),
      (6, 1, 400, 'Title 6', 'Text 6', 1),
      (7, 1, 200, 'Title 7', 'Text 7', 1);
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>select * from job
      where type = 1
      group by group_id
      order by rand()
  </code></pre>