От: A. Kretschmer
Тема: Re: How to SELECT
Дата: ,
Msg-id: 20100311071417.GB1035@a-kretschmer.de
(см: обсуждение, исходный текст)
Ответ на: How to SELECT  (Angayarkanni)
Ответы: Re: How to SELECT  (Angayarkanni)
Список: pgsql-performance

Скрыть дерево обсуждения

How to SELECT  (Angayarkanni, )
 Re: How to SELECT  ("A. Kretschmer", )
  Re: How to SELECT  (Angayarkanni, )
 Re: How to SELECT  (Dave Crooke, )

In response to Angayarkanni :
> Hi,
> I am the beginner of pgpsql
> I need to select from two tables say T1,T2 by UNION
> when the value is from T1 the output should by a 1 and
> when the value from T2 the out put should be 2
> when T1 Hits values should be 1 and when T2 hits the value should be 2

select 'table 1' as table, * from t1 union all select 'table 2', * from t2;

Regards, Andreas
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

В списке pgsql-performance по дате сообщения:

От: Greg Smith
Сообщение: Re: shared_buffers advice
От: "elias ghanem"
Сообщение: Is DBLINK transactional