Jump to content

Sorting records after a count()


skyer2000

Recommended Posts

I'm pretty sure this is suitable for the PHP forum as the solution is probably going to require some PHP code.

 

What I have right now is a query that pulls results from a database and orders them by "date, priority, status". These are parent records, which can have a certain amount of child records underneath them. So for example, one record might have 3 child records, and I also need it to sort by that.

 

Since getting the number of child records requires another count() query, how would I go about sorting by which record has the most child records?

Link to comment
https://forums.phpfreaks.com/topic/49099-sorting-records-after-a-count/
Share on other sites

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.