I have a table with different categories. Is it possible to return two random rows from each category?
My table:
-----------------------------
| ID | CATEGORY |
-----------------------------
| 1 | PINK |
| 2 | GREEN |
| 3 | PINK |
| 4 | GREEN |
| 5 | BLUE |
| 6 | BLUE |
| 7 | BLUE |
| 8 | PINK |
| 9 | GREEN |
-----------------------------
What I want to output:
-----------------------------
| ID | CATEGORY |
-----------------------------
| 1 | PINK |
| 8 | PINK |
| 2 | GREEN |
| 4 | GREEN |
| 6 | BLUE |
| 7 | BLUE |
-----------------------------