Re: SELECT from multiple tables (not join though)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: SELECT from multiple tables (not join though)
Дата
Msg-id 20050110180047.GA24404@dcc.uchile.cl
обсуждение исходный текст
Ответ на Re: SELECT from multiple tables (not join though)  (Madison Kelly <linux@alteeve.com>)
Список pgsql-general
On Mon, Jan 10, 2005 at 12:47:53PM -0500, Madison Kelly wrote:

Madison,

> The trick now is I need to know which table each result came from. I can
> add another column and record the table number and SELECT that at the
> same time but before I do I was wondering if I can do this more
> efficiently or elegantly.

You can get the Oid of the table very easily with the "tableoid" column.
If you want the name you can use tableoid::regclass, though I'm not sure
if that works as a normal text column.

Be sure to grok the difference between UNION and UNION ALL (which is the
fact that UNION sorts and "uniqs" its input).

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
Oh, oh, las chicas galacianas, lo harán por las perlas,
¡Y las de Arrakis por el agua! Pero si buscas damas
Que se consuman como llamas, ¡Prueba una hija de Caladan! (Gurney Halleck)

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

Предыдущее
От: Madison Kelly
Дата:
Сообщение: Re: SELECT from multiple tables (not join though)
Следующее
От: Madison Kelly
Дата:
Сообщение: Re: SELECT from multiple tables (not join though)