On 16 Nov 2013, at 3:14pm, James K. Lowden wrote:
> On Sun, 10 Nov 2013 14:36:06 -0800
> Igor Korot wrote:
>
>> Well from strictly mathematical point of view maximum or minimum of
>> nothing is nothing. And since nothing is 0, than it is zero.
>
On Sun, 10 Nov 2013 14:36:06 -0800
Igor Korot wrote:
> Well from strictly mathematical point of view maximum or minimum of
> nothing is nothing. And since nothing is 0, than it is zero.
Who is the oldest female US president?
You largest of a set must be a member of that
On 11/11/2013 12:36 AM, Igor Korot wrote:
Well from strictly mathematical point of view maximum or minimum of
nothing is nothing. And since nothing is 0, than it is zero. Thank you.
max() can't simply pull 0 out of the air, for it 0 is the same random
number as 1e-129 which might be also
On 10 Nov 2013, at 10:36pm, Igor Korot wrote:
> On Sun, Nov 10, 2013 at 8:44 AM, Simon Slavin wrote:
>
>> On 10 Nov 2013, at 4:26pm, Igor Korot wrote:
>>
>>> I'm updating the table when the program exit.
>>
>> There is not need
Simon,
On Sun, Nov 10, 2013 at 8:44 AM, Simon Slavin wrote:
>
> On 10 Nov 2013, at 4:26pm, Igor Korot wrote:
>
>> I'm updating the table when the program exit.
>
> There is not need to update the table. In fact there's no need to store the
> rank
If Igor "must have a number" for the "max", even when there are no rows,
then I'm certain that the coalesce() function is exactly what he needs to
use. coalesce(max(id),0)) will give the maximum "id" value of the result
set or 0 if there are no results in the result set (NULL).
On Sun, Nov 10,
On 10 Nov 2013, at 4:26pm, Igor Korot wrote:
> I'm updating the table when the program exit.
There is not need to update the table. In fact there's no need to store the
rank values at all.
> Now, I would expect for the max() function in this case to be
> evaluated to 0
Simon et al,
On Sun, Nov 10, 2013 at 7:18 AM, Simon Slavin wrote:
>
> On 10 Nov 2013, at 3:05pm, Igor Tandetnik wrote:
>
>> That rather depends on what value you deem to be the correct one. You've
>> never explained the desired outcome of all this
On 10 Nov 2013, at 3:05pm, Igor Tandetnik wrote:
> That rather depends on what value you deem to be the correct one. You've
> never explained the desired outcome of all this choreography.
He's trying to keep each player's rank in his league table. And he wants the
rank
On 11/10/2013 12:54 AM, Igor Korot wrote:
CREATE TRIGGER playersinleague_insert AFTER INSERT on playersinleague
BEGIN
UPDATE playersinleague SET current_rank = 1+ (select max(
current_rank ) from playersinleague WHERE id = new.id), original_rank
= current_rank WHERE id = new.id AND
On 10 Nov 2013, at 12:34pm, John McKown wrote:
> If you need a particular "default" value instead of a NULL, use the
> coalesce() function.
>
> select coalesce(max(current_rank),0) FROM playersinleague WHERE id = 1;
Purely for clarity's sake, and not to say
I would expect NULL (empty string) as the result from a max (or any other
summary) query which has "no rows". Any particular value wouldn't make too
much sense to me. Why any particular value? 0 doesn't really make sense.
Well no more or less sense than -1 or even -10372 (picked "at random").
If
I just tried to do:
SELECT max(current_rank) FROM playersinleague WHERE id = 1;
and I got an empty string and not 0.
Is this a bug? Should max(field) return 0 if there is no records that
satisfy criteria?
Thank you.
On Sat, Nov 9, 2013 at 9:54 PM, Igor Korot wrote:
> Hi,
13 matches
Mail list logo