Using ROLLUP in my GROUP BY, I have been able to get MySQL to insert sub-total lines, which is great. However, it would be even better if I could determine the text on those subtotal lines. Here's my query:

SELECT Sc.State, St.Description, Count(*)
FROM InvHead I
  JOIN Schools Sc on Sc.ID=I.ChapterID
  JOIN Participants P ON P.InvNo=I.InvNo
  JOIN StatusCodes St ON P.Status=St.Code
GROUP BY Sc.State, St.Description WITH ROLLUP

I have seen examples that use (I believe) MS SQL and the Grouping() function to determine if the row is an inserted subtotal or total row. Is there a way to determine if the row is a subtotal or total row, and change the text to indicate which it is?

Jesse

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to