Re: SELECT from multiple tables (not join though)

Поиск
Список
Период
Сортировка
От Madison Kelly
Тема Re: SELECT from multiple tables (not join though)
Дата
Msg-id 41E2DAF1.9050309@alteeve.com
обсуждение исходный текст
Ответ на Re: SELECT from multiple tables (not join though)  ("Frank D. Engel, Jr." <fde101@fjrhome.net>)
Список pgsql-general
Frank D. Engel, Jr. wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> SELECT file_name, 1 FROM file_info_1 WHERE file_parent_dir='/' UNION
> SELECT file_name, 2 FROM file_info_2 WHERE file_parent_dir='/' UNION
> SELECT file_name, 3 FROM file_info_3 WHERE file_parent_dir='/'
> ORDER BY file_name;
>
> The second column now shows which table it came from.  No need to mess
> with adding fields, OIDs, etc...

Thank you Frank, Bruno and Derik,

   That worked wonderfully! Derik's suggestion also worked perfectly,
too. I would imagine this method is slightly faster that his because I
am not really assigning anything? I guess I will need to run some
benchmarks. It is really nice to have options though.

   Thank you all again! The amount of time you guys have saved me since
I joined is just phenominal!

Madison


В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: Function for retreiving datatype
Следующее
От: Pierre-Frédéric Caillaud
Дата:
Сообщение: Re: Function for retreiving datatype