Re: show data from two tables together - Mailing list pgsql-sql

From Matthew Nuzum
Subject Re: show data from two tables together
Date
Msg-id 000001c2bd11$e76058e0$6700a8c0@mattspc
Whole thread Raw
In response to Re: show data from two tables together  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-sql
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;




pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: show data from two tables together
Next
From: Tom Lane
Date:
Subject: Re: RFC: A brief guide to nulls