Answer the question
In order to leave comments, you need to log in
How to organize random sorting by a specific field?
Good afternoon!
I asked myself this question:
Is it possible to organize sorting by one field with additional random sorting by the second field?
For example:
There is a table like this
---------------------------------
| id | title | type| created_at |
---------------------------------
| 1 | A | 2 | 21.10.2017 |
| 2 | B | 2 | 22.10.2017 |
| 3 | C | 2 | 23.10.2017 |
| 4 | D | 3 | 24.10.2017 |
| 5 | E | 4 | 25.10.2017 |
---------------------------------
------------------------------------
| id | title | type ↓ | created_at |
------------------------------------
| 2 | B | 2 | 22.10.2017 |
| 1 | A | 2 | 21.10.2017 |
| 3 | C | 2 | 23.10.2017 |
| 4 | D | 3 | 24.10.2017 |
| 5 | E | 4 | 25.10.2017 |
------------------------------------
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question