0
votes
1answer
235 views

Getting MySQL User Variable in Sequence, While Using ORDER BY RAND()

I am running a SELECT statement, which ultimately will be in an INSERT..SELECT statement. I want a result like this ID COUNTER 3 1 7 2 1 3 20 4 12 ...
7
votes
4answers
3k views

How do I do a complex GROUP BY in MySQL?

I have a table that contains several keys into other tables (where each key is comprised of multiple columns). I would like to be able to group rows together that have an equal key, but I don't want ...
3
votes
1answer
3k views

How do I make MySQL auto increment in random order?

I have a table that contains several keys into other tables (where each key is comprised of multiple columns). I would like to create a new column for each key that would be an integer such that ...