I have a table with errors. BugTitle is the page error, and I also commit the error line. I would like to create an SQL query that selects the top 10 errors based on bugtitle strings and errors. I have this query:
SELECT COUNT(BugTitle) AS BugCount, BugTitle, ErrLine FROM Bugs WHERE BugDate >= DateAdd(Day, -30, DateDiff(Day, 0, GetDate())) GROUP BY BugTitle, ErrLine ORDER BY BugCount, ErrLine DESC
But I'm not sure if this is correct. I am pretty sure that my test data has only one error, which occurs on one line, but does not appear with this query. Can anyone help?
source share