January 2, 2004 at 7:43 pm
Consider the following example:
select a.totalminutes,
m.memberid,
m.meetingid
frommeeting m,
(select sum(x.minutes) as totalminutes,
x.meeringid
frommeeting x
group by x.meetingid
) a
where a.meetingid = x.meetingid
memberid could not be included in the group by, so I used a derived table to do the grouping. This works well. However, I had to write the query for mySQL, which does not support derived tables. I solved the problem by summing on the front-end. But could I have written the query in another way to give me all the information that I need?
Edited by - jxflagg on 01/02/2004 7:49:28 PM
January 3, 2004 at 12:58 pm
If you are asking how to write this query in MySQL, I would post it to their mailing list. MySQL handles some things differently.
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
January 3, 2004 at 9:24 pm
Thanks Frank. However, I'm really asking, is there a way to write this query without utilizing a derived table.
January 4, 2004 at 12:10 pm
Which version of MySQL are you on?
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
January 4, 2004 at 1:40 pm
Hm, maybe it's too late or maybe I'm too dumb
Why is there a GROUP BY in your query?
May you please explain very slowly your query to me?
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
January 4, 2004 at 2:38 pm
Finally it hits me. Forget my last post
...but no solution anyway
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply