pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Casey Allen Shobe <cshobe@osss.net>
To: pgsql-sql@postgresql.org
Subject: Combining queries while preserving order in SQL - Help!
Date: Mon, 2 Dec 2002 13:46:38 -0500
Message-ID: <200212021346.38338.cshobe@osss.net> (raw)

Hi there,

I need to do the following in one SQL query:

select field1, field2, field3, field4, field5 from table where field6 < 5
order by field1

And a totals line which shows the sum for each column.

The important part is that I need to preserve the order by of the first query.

Is there any way to do this in one query?

Thank you,

-- 
Casey Allen Shobe, Open Source Software Solutions
cshobe@osss.net / http://www.osss.net / 770-653-4526



view thread (2+ messages)  latest in thread

Message-ID: <200212021346.38338.cshobe@osss.net>
Permalink:  ../200212021346.38338.cshobe@osss.net/
Also on:    postgresql.org/message-id/200212021346.38338.cshobe@osss.net

 · 

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: cshobe@osss.net
  Subject: Re: Combining queries while preserving order in SQL - Help!
  In-Reply-To: <200212021346.38338.cshobe@osss.net>

* 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