Jump to content

Sorting mySQL Results


Hartley

Recommended Posts

All right, in this table, there are two different columns with timestamps, going to give them the variables $join and $leave for now. I can select all of them just fine, however, I need to do one sort. I need to see how many of these have a difference of two weeks in the $join and $leave (Or 1209600 difference in the timestamps).

 

I simply need a count of of them. Is there a way to construct this query to get what I'm looking for?

Link to comment
https://forums.phpfreaks.com/topic/65164-sorting-mysql-results/
Share on other sites

It works good so far, but when I throw in a count(id), I get another error. Is there perhaps a way to do the count outside of the mySQL, or with a different syntax, so I can get a count of all the rows that fit this query?

 

Thanks again!

 

Mixing of GROUP columns (MIN(),MAX(),COUNT()...) with no GROUP columns is illegal if there is no GROUP BY clause
Link to comment
https://forums.phpfreaks.com/topic/65164-sorting-mysql-results/#findComment-325854
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.