Jump to content

mysql how to organize by the no. of rows?


ted_chou12

Recommended Posts

I want to organize according to the number of entries, every row has a column value called threadid, which may repeat for different rows, so I wish to put the most frequent appearing threadid on the top, and least at the bottom, is this suppose to be done with GROUP? or something else?

Thank you

Ted

Link to comment
https://forums.phpfreaks.com/topic/37992-mysql-how-to-organize-by-the-no-of-rows/
Share on other sites

sorry, I didnt explain clearly enough, I wish to organize the rows by the frequency of the appearance, for example:

id threadid

1 2

2 3

3 1

4 2

5 4

 

so I want the order to look like:

2 (2 comes first because it occured the most frequent.)

3

1

4

the rest would automatically organize by id, since they have the same frequency.

Ted

Hope that makes it clear

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.