var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: SQL Statement Help Please
have a table of statistical information which can contain zero or entries for a given day. I would like a single statement to find which day has the most entries on it.
The following statement will list the days and the number of entries for that day.
SELECT Date, MAX(COUNT(ID)) FROM Stats WHERE CompanyD=2 GROUP BY Date
Is there a way I can modify this statement so it returns a single row with the Date and the number of rows for that Date, but only for the Date with the most rows.
Hope thats clear.
tip: don't use a reserved word like Date for a column name, you are only asking for syntax errors
, count(ID) as rows
where CompanyD = 2
by rows desc
It is actually quite simple really isn't it.
At least it is when you know how. Again thanks