pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matthew Nuzum <cobalt@bearfruit.org>
To: 'Stephan Szabo' <sszabo@megazone23.bigpanda.com>
To: 'Matthew Nuzum' <cobalt@bearfruit.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: show data from two tables together
Date: Wed, 15 Jan 2003 22:46:48 -0500
Message-ID: <000001c2bd11$e76058e0$6700a8c0@mattspc> (raw)
In-Reply-To: <20030115191320.R98147-100000@megazone23.bigpanda.com>

Hmm... I've never used this before.  I'll try it.

Thanks for your help and your quick reply!

--
Matthew Nuzum
www.bearfruit.org
cobalt@bearfruit.org
 

> Fortunately we have the set functions, specifically UNION ALL in this
> case.
> 

> Maybe something like (minus the number of files/empty part):
> 
> CREATE VIEW viewname AS
>  SELECT fileid, filename, folderid, dsply_order FROM files
>   UNION ALL
>  SELECT folderid, foldername, parentid, dsply_order FROM folders;
> 
> SELECT * from viewname where folderid=23 order by dsply_order;





view thread (3+ messages)

Message-ID: <000001c2bd11$e76058e0$6700a8c0@mattspc>
Permalink:  ../000001c2bd11$e76058e0$6700a8c0@mattspc/
Also on:    postgresql.org/message-id/000001c2bd11$e76058e0$6700a8c0@mattspc

 · 

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: cobalt@bearfruit.org, sszabo@megazone23.bigpanda.com
  Subject: Re: show data from two tables together
  In-Reply-To: <000001c2bd11$e76058e0$6700a8c0@mattspc>

* 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