Re: How to SELECT

Поиск
Список
Период
Сортировка
От Dave Crooke
Тема Re: How to SELECT
Дата
Msg-id ca24673e1003102315g699fc0d0sbd3feac4545a6b37@mail.gmail.com
обсуждение исходный текст
Ответ на How to SELECT  (Angayarkanni <kangayarkanni@gmail.com>)
Список pgsql-performance
Hi there

This list is for performance tuning questions related to PostgreSQL ... your question is a general SQL syntax issue. Also, it's not quite clear from your message exactly what you are trying to do - it's better to post example table schemas.

At a guess, I think you might want:

select 1, * from T1
union all
select 2, * from T2

Cheers
Dave

On Thu, Mar 11, 2010 at 12:56 AM, Angayarkanni <kangayarkanni@gmail.com> wrote:
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


or when we use
COALESCE(is exits  value, or this value)

i need
say_some_function (if value display,1)

results should be as
1
1
2
2
1
1

Is it possible Can any one help me...

Thanks & Regards
AK


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

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: How to SELECT
Следующее
От: Angayarkanni
Дата:
Сообщение: Re: How to SELECT