Icon View Thread

The following is the text of the current message along with any replies.
Messages 21 to 29 of 29 total
Thread RecNo equivalent
Wed, Jul 30 2008 5:21 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I see where you're coming from now. But in that scenario, unless he's
moved off the last record, it would be easier just to go .Next and keep on.
>>

It's not even worth the time considering such an option.  You'll save a few
ticks, period, and introduce a bunch of code for no reason.  Just use
bookmarks and it works in all cases, and is fast.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Jul 30 2008 5:23 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Just trying it again,

select runsum(1),_Name from companies

ElevateDB Error #700 An error was found in the statement at line 1 and
column 18 (Invalid expression "_Name" found, the necessary GROUP BY clause
is missing)

Reading the manual I can't reconcile what I'm reading with the effect I'm
getting. I think <<The selected rows can be grouped into logical sub-sets by
using the GROUP BY...>> should read "The selected rows MUST be grouped into
logical sub-sets by using the GROUP BY..." together with something about if
you only have a runsum column it'll consider the whole select clause as its
group and you end up with one number. >>

Where in the manual are you getting this text that you're referring to ?
This behavior is standard GROUP BY behavior.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jul 31 2008 3:59 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>Where in the manual are you getting this text that you're referring to ?

The section on RUNSUM in the sql manual attached to EDBManager

>This behavior is standard GROUP BY behavior.

I'm not saying it isn't, just that the word "can" should be replaced by "must". To me "can" indicates its optional, and unless you take the special case of no other columns it is mandatory.

Roy Lambert
Thu, Jul 31 2008 5:30 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I'm not saying it isn't, just that the word "can" should be replaced by
"must". To me "can" indicates its optional, and unless you take the special
case of no other columns it is mandatory. >>

It *is* optional.  If you don't specify a GROUP BY, then you get a
single-column, single-row result set with the RUNSUM() result for the entire
set.  This is standard aggregate behavior.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jul 31 2008 6:08 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>It *is* optional. If you don't specify a GROUP BY, then you get a
>single-column, single-row result set with the RUNSUM() result for the entire
>set.

We have different definitions of the word optional

>This is standard aggregate behavior.

And glancing at a couple of the other functions I see they used the same template for their definition Smiley

Roy Lambert

Thu, Jul 31 2008 6:24 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< We have different definitions of the word optional >>

You're assuming that someone wouldn't want a single-row, single-value result
from a query like this:

SELECT RUNSUM(MyColumn) FROM MyTable

Why are you assuming that this is not a valid query ?

<< And glancing at a couple of the other functions I see they used the same
template for their definition Smiley>>

Yes, their behaviors are all exactly the same.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jul 31 2008 7:25 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>You're assuming that someone wouldn't want a single-row, single-value result
>from a query like this:
>
>SELECT RUNSUM(MyColumn) FROM MyTable
>
>Why are you assuming that this is not a valid query ?

I'm not which is why I had "together with something about......" in the post

I'm trying to remember an old saying that's perfect for this. I think it was to do with China under the first dynasty but I'm probably wrong. It was either "whatever is not banned is mandatory" or "whatever is not mandatory is banned".

I would consider it optional there if

SELECT RUNSUM(MyColumn) FROM MyTable GROUP BY MyColumn

made sense Smiley I know its doable but I can't think of any of my tables where it would make sense. OTOH I'm sure there's someone out there with an example.

Roy Lambert
Thu, Jul 31 2008 8:17 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I would consider it optional there if

SELECT RUNSUM(MyColumn) FROM MyTable GROUP BY MyColumn

made sense Smiley I know its doable but I can't think of any of my tables
where it would make sense. OTOH I'm sure there's someone out there with an
example. >>

EDB, unlike DBISAM, allows you to reference expressions in the ORDER BY and
GROUP BY clauses that don't exist in the SELECT columns list.  Therefore,
the above will give you a RUNSUM() of MyColumn, grouped by MyColumn.   That
query in particular is nonsensical due to the column being referenced in the
GROUP BY, but this isn't:

SELECT RUNSUM(ItemsTotal) FROM orders
GROUP BY custno

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Jul 31 2008 8:50 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>EDB, unlike DBISAM, allows you to reference expressions in the ORDER BY and
>GROUP BY clauses that don't exist in the SELECT columns list.

Now that was DBISAM thinking SmileyOK I'll accept optional.

Roy Lambert
« Previous PagePage 3 of 3
Jump to Page:  1 2 3
Image