Igor,
On Fri, Oct 25, 2013 at 3:26 PM, Igor Tandetnik wrote:
> On 10/25/2013 5:53 PM, Igor Korot wrote:
>
>> If I do something like this:
>>
>> CREATE TRIGGER AFTER INSERT
>> {
>> SELECT max( current_rank ) AS a FROM leagueplayers WHERE leagueid = 1;
>> UPDATE leagueplayers
On 10/25/2013 5:53 PM, Igor Korot wrote:
If I do something like this:
CREATE TRIGGER AFTER INSERT
{
SELECT max( current_rank ) AS a FROM leagueplayers WHERE leagueid = 1;
UPDATE leagueplayers SET current_rank = a WHERE leagueid = 1 AND
current_rank IS NULL;
}
Something along these lines might
Hi, guys,
On Fri, Oct 25, 2013 at 6:19 AM, Igor Tandetnik wrote:
> On 10/24/2013 10:48 PM, Igor Korot wrote:
>
>> INSERT INTO leagueplayers SELECT players.playerid, %d, ... ORDER BY
>> players.rank;
>>
>> Now my language of choice is C++ and what I'm looking for is a way to
On 10/24/2013 10:48 PM, Igor Korot wrote:
INSERT INTO leagueplayers SELECT players.playerid, %d, ... ORDER BY
players.rank;
Now my language of choice is C++ and what I'm looking for is a way to
populate the current_rank and original_rank in the leagueplayers table.
They should come up as
Stephan Beal wrote:
> On Fri, Oct 25, 2013 at 12:51 PM, Clemens Ladisch wrote:
>> CREATE TEMP TABLE t(playerid, leagueid, auto_rank INTEGER PRIMARY KEY);
>> INSERT INTO t(playerid, leagueid) SELECT players.playerid, %d FROM ...;
>> INSERT INTO leagueplayers(playerid, leagueid,
On Fri, Oct 25, 2013 at 12:51 PM, Clemens Ladisch wrote:
> CREATE TEMP TABLE t(playerid, leagueid, auto_rank INTEGER PRIMARY KEY);
> INSERT INTO t(playerid, leagueid) SELECT players.playerid, %d FROM ...;
> INSERT INTO leagueplayers(playerid, leagueid, current_rank,
Igor Korot wrote:
> On Fri, Oct 25, 2013 at 2:12 AM, Clemens Ladisch wrote:
>> Igor Korot wrote:
>>> what I'm looking for is a way to populate the current_rank and
>>> original_rank in the leagueplayers table. They should come up as
>>> auto-incremented values.
>>> Is there a
Hi, Clemens,
On Fri, Oct 25, 2013 at 2:12 AM, Clemens Ladisch wrote:
> Igor Korot wrote:
> > what I'm looking for is a way to populate the current_rank and
> > original_rank in the leagueplayers table. They should come up as
> > auto-incremented values.
>
> Autoincrementing
Igor Korot wrote:
> what I'm looking for is a way to populate the current_rank and
> original_rank in the leagueplayers table. They should come up as
> auto-incremented values.
Autoincrementing works only for INTEGER PRIMARY KEY columns.
> Is there a way to do that or I will have to change the
Hi, ALL,
Consider the following schema:
CREATE TABLE players(
playerid INTEGER PRIMARY KEY,
name TEXT,
rank INTEGER);
CREATE TABLE leagueplayers(
playerid INTEGER,
leagueid INTEGER,
current_rank INTEGER
original_rank INTEGER);
The fields rank, current_rank and original_rank are recent addition
10 matches
Mail list logo