pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Marcus Claesson <m.claesson@student.ucc.ie>
Cc: pgsql-sql@postgresql.org
Subject: Re: can't get the order I want after inserting new rows
Date: Fri, 17 Dec 2004 12:37:05 +0000
Message-ID: <41C2D2F1.4090205@archonet.com> (raw)
In-Reply-To: <1103276805.17814.493.camel@morpheus.ucc.ie>
References: <1103276805.17814.493.camel@morpheus.ucc.ie>

Marcus Claesson wrote:
> Hi!
> 
> I have a problem with getting the order I want on a table after new rows
> have been inserted. I try to simplify it...:

> In other words, I have this old table:
> SELECT * from table ORDER BY full,part;
> 
> name    full    part    score
> ----    ---     ---     -----
> a       1       1       900
> a       1       2       500

> and I insert these rows into the same table:
> (there's nothing I can do about these 'full' values)
> 
> d       1       1       1000
> d       1       2       400

> And after some manipulation (that I hope someone can help me with) I
> want the query above (SELECT * from table ORDER BY full,part) to give
> this:
> 
> d       1       1       1000
> d       1       2       400
> a       2       1       900

Just looking at the start of your output, you are missing some rows 
(a/1/1) and have replaced others (a/2/1 isn't in your data).

Are you trying to summarise, and if so by what?
Can you explain how you would do this by hand.
Could you provide the actual table definition?

-- 
   Richard Huxton
   Archonet Ltd



view thread (4+ messages)  latest in thread

Message-ID: <41C2D2F1.4090205@archonet.com>
Permalink:  ../41C2D2F1.4090205@archonet.com/
Also on:    postgresql.org/message-id/41C2D2F1.4090205@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dev@archonet.com, m.claesson@student.ucc.ie
  Subject: Re: can't get the order I want after inserting new rows
  In-Reply-To: <41C2D2F1.4090205@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox