Re: show data from two tables together

Поиск
Список
Период
Сортировка
От Matthew Nuzum
Тема Re: show data from two tables together
Дата
Msg-id 000001c2bd11$e76058e0$6700a8c0@mattspc
обсуждение исходный текст
Ответ на Re: show data from two tables together  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список 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 по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: show data from two tables together
Следующее
От: Tom Lane
Дата:
Сообщение: Re: RFC: A brief guide to nulls