RE: Using Max Function on more that two data values

2008-09-25 Thread Bobby Hartsfield
Neah... it's overrated. ..:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com http://cf4em.com -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2008 11:45 AM To: CF-Talk Subject: Re: Using Max Function on more that two data v

Re: Using Max Function on more that two data values

2008-09-24 Thread s. isaac dealey
> He added the order by desc, so that it sorted the highest to lowest.. > Had it been asc, you would have gotten the four smallest returns. Parkhill makes the layup! :) He's right the "order by TotalVotes desc" in the query sorted the results highest to lowest and then maxrows="1" just cut it do

Re: Using Max Function on more that two data values

2008-09-24 Thread Rob Parkhill
He added the order by desc, so that it sorted the highest to lowest.. Had it been asc, you would have gotten the four smallest returns. Rob On Wed, Sep 24, 2008 at 4:52 PM, Fawzi Amadu <[EMAIL PROTECTED]> wrote: > Sorry for the premature posting I mistakenly hit the enter key. Now to my > questi

Re: Using Max Function on more that two data values

2008-09-24 Thread Fawzi Amadu
Sorry for the premature posting I mistakenly hit the enter key. Now to my question Hi S. Isaac, this worked fine after some tweeking. Currently my first query returns 24 rows of records (because there are currently for constituencies returning results and each has 6 parties participating)so I

Re: Using Max Function on more that two data values

2008-09-24 Thread Fawzi Amadu
Hi S. Isaac, this worked fine after some tweeking. Currently my first query returns 24 rows of records (because there are currently for constituencies returning results and each has 6 parties participating), but the logic beats me, how is it that your >> > >After this query, add a query of qu

Re: Using Max Function on more that two data values

2008-09-24 Thread s. isaac dealey
> Well, I guess if you want to _read_ and all. ;) It's easier to find the time to read when you've got a smaller number of open source project emails to respond to. ;) -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 781.769.0723 http://onTap.riaforge.org/blog ~~~

Re: Using Max Function on more that two data values

2008-09-24 Thread Raymond Camden
Well, I guess if you want to _read_ and all. ;) On Wed, Sep 24, 2008 at 10:17 AM, s. isaac dealey <[EMAIL PROTECTED]> wrote: >> Actually MAX works in QofQ. I'd use that instead of maxrows: >> >> >> select max(something) as maxvalue from somequery >> > > Except that they wanted the max count and

Re: Using Max Function on more that two data values

2008-09-24 Thread s. isaac dealey
> Actually MAX works in QofQ. I'd use that instead of maxrows: > > > select max(something) as maxvalue from somequery > Except that they wanted the max count and the name, not just the max -- s. isaac dealey ^ new epoch isn't it time for a change? ph: 781.769.0723 http://onTap.riafo

Re: Using Max Function on more that two data values

2008-09-24 Thread Raymond Camden
Actually MAX works in QofQ. I'd use that instead of maxrows: select max(something) as maxvalue from somequery On Tue, Sep 23, 2008 at 6:14 PM, s. isaac dealey <[EMAIL PROTECTED]> wrote: >> >> >> SELECT c.ConstituencyName, s.ConstituencyNo, v.Party, Sum(v.Votes) AS >> TotalVotes >> From (Const

Re: Using Max Function on more that two data values

2008-09-23 Thread s. isaac dealey
> > > SELECT c.ConstituencyName, s.ConstituencyNo, v.Party, Sum(v.Votes) AS > TotalVotes > From (Constituency c > INNER JOIN PollingStation s ON c.ConstituencyNo = s.ConstituencyNo) > INNER JOIN VoteResults v ON s.AgentPhoneNo = v.AgentPhoneNo > WHERE v.ResultCategory = 'L' AND s.ConstituencyNo

Using Max Function on more that two data values

2008-09-23 Thread Fawzi Amadu
Hello, I have a query that returns sum of votes for each party in a constituency and I need to find out which party had the most votes within each constituency. Here is more detail about what I have done and what I want to do. I have the following tables along with their attributes(the stared fi