This is a discussion on Using GROUP BY and RAND() within the MySQL Database forums, part of the Database Forums category; Hi people :) I'm having a problem with a request using ORDER BY RAND() and GROUP BY : SELECT a.id_a, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi people :)
I'm having a problem with a request using ORDER BY RAND() and GROUP BY : SELECT a.id_a, b.id_b FROM table_A a, table_B b GROUP BY a.id_a ORDER BY RAND() The result I'd like to get would be a table with all my distincts "id_a" from "table_A", associated, each one, with a random value of "id_b" contained in my table "Table_B" I apologize for my english :). If you have an idea ... thanks :) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|