pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adam Ruth <aruth@intercation.com>
To: Michael Glaesemann <grzm@myrealbox.com>
Cc: Andy Lewis <jumboc@comcast.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: sort by on two columns
Date: Fri, 2 Jan 2004 21:32:51 -0700
Message-ID: <E473BEC6-3DA5-11D8-89B7-000A959D1424@intercation.com> (raw)
In-Reply-To: <85E086DE-3D99-11D8-A298-000A95C88220@myrealbox.com>
References: <003a01c3d1a5$0cb603d0$0201a8c0@andy2>
	<85E086DE-3D99-11D8-A298-000A95C88220@myrealbox.com>

Sounds like you may want to concatenate the columns:

... order by table1.name || table2.name

The sorting would then be performed on both of the them as though they 
were one column.

Adam Ruth

On Jan 2, 2004, at 8:04 PM, Michael Glaesemann wrote:

>
> On Jan 2, 2004, at 8:55 PM, Andy Lewis wrote:
>> Yes, I understand this but, I would like to have the results of both
>> "table1.name, table2.name"
>> sorted as one column.
>>
>> Is this possible?
>
> So you want one column of name, including names from both table1 and 
> table2? In that case, you need to use UNION, I believe. If it's 
> something else, I'm not sure I understand what you're asking. Perhaps 
> you could include a sample of what you're getting, along with what 
> you'd like to see?
>
> Michael Glaesemann
> grzm myrealbox com
>
>
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>




view thread (6+ messages)

Message-ID: <E473BEC6-3DA5-11D8-89B7-000A959D1424@intercation.com>
Permalink:  ../E473BEC6-3DA5-11D8-89B7-000A959D1424@intercation.com/
Also on:    postgresql.org/message-id/E473BEC6-3DA5-11D8-89B7-000A959D1424@intercation.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: aruth@intercation.com, grzm@myrealbox.com, jumboc@comcast.net
  Subject: Re: sort by on two columns
  In-Reply-To: <E473BEC6-3DA5-11D8-89B7-000A959D1424@intercation.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