Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D40FA63427D for ; Thu, 11 Mar 2010 02:56:33 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 11337-07 for ; Thu, 11 Mar 2010 06:56:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f187.google.com (mail-iw0-f187.google.com [209.85.223.187]) by mail.postgresql.org (Postfix) with ESMTP id 618CD633E5D for ; Thu, 11 Mar 2010 02:56:23 -0400 (AST) Received: by iwn17 with SMTP id 17so5016841iwn.19 for ; Wed, 10 Mar 2010 22:56:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type; bh=LjodrvMReAIw820rA8CIzFfFXWD4umjPGbAzx/yKxv4=; b=vOlt/nLiqdWmpAkQExLa/rLqlPZmNACkd7N57ZOcSI1D6NKvy3ZbbHYSY/Zb0G+bIE 1zT96Wef+hUinpX+kpRLEeTxJRPToml063eOPhlc/iQpQswTtBhHaYv16W6+DtguU0C+ crmkxb8tSgLSPgOE4AXbVwCBqshGqrXPSaE5g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=e4uugUr/u709evthMgP11h8vC6OoVC0QR7CJVN+AbLUYH+pWXPhVb9XjvApieHLnBu IhCPrZSGrWg9BLQmTXNJBdsNylGaAn/M/xMHiB3NryKL/Li7MJ5pt+Cjf2mqXCvyjPQU m+V48ngEu4bTIwDujdLnlfh9FEIjAjK6YCVNk= MIME-Version: 1.0 Received: by 10.231.146.74 with SMTP id g10mr117537ibv.98.1268290582237; Wed, 10 Mar 2010 22:56:22 -0800 (PST) From: Angayarkanni Date: Thu, 11 Mar 2010 12:26:02 +0530 Message-ID: <2a77004c1003102256l24af41e5ueab35874f5320ffa@mail.gmail.com> Subject: How to SELECT To: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=0016e6408a20a053c6048180e927 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.184 tagged_above=-10 required=5 tests=BAYES_40=-0.185, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201003/122 X-Sequence-Number: 37947 --0016e6408a20a053c6048180e927 Content-Type: text/plain; charset=ISO-8859-1 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 --0016e6408a20a053c6048180e927 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I am the beginner of pgpsql

=A0<= br>I need to select from two tables say T1,T2 by UNION

when the val= ue is from T1 the output should by a 1 and
when the value from T2 the o= ut put should be 2

when T1 Hits values should be 1 and when T2 hits the value should be 2<= br>

or when we use
COALESCE(is exits=A0 value, or this value)
i need
say_some_function (if value display,1)

results sho= uld be as
1
1
2
2
1
1

Is it possible Can any one help me...
Thanks & Regards
AK

--0016e6408a20a053c6048180e927--