Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id DEBAC62E9D4 for ; Thu, 11 Mar 2010 03:23:57 -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 16603-04 for ; Thu, 11 Mar 2010 07:23:47 +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 498D46326FD for ; Thu, 11 Mar 2010 03:23:47 -0400 (AST) Received: by iwn17 with SMTP id 17so5031530iwn.19 for ; Wed, 10 Mar 2010 23:23:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=81WVlnB9//5VlmnOSYlNRQsltMLeaL39NuhN3gldIEs=; b=IUmYmW8Js9exJtwqbFfrzvsWym/AcLn15fCD/8JjwLCCxNNsKvWPEnVVAZI4YSfltG KhyTnJam1gvOJ7m4WTK1J7RGDYl1Go6yea8y2u0NDiT+Vk0QM5Jj4q4bQS7Yui+RMp8y y+KyWtMy5JfmBCoXc6aFy8SymKoTYg7MMUTuY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=ValQDLDl1YIMlzR6MWG5LZS8pAFaTD5WBeBkPG4cVN6VoWnGuqIuHINEzImHUG3lvK dKIKEylcyUU8aRnCm0nUXkohBICIp8VzJDa9O/G7j54wK5HbOe2wm52YgkxUk0y6G5ow mx6TEgVBZFOpT1z16MyD54S6Bqw16zUCpV6tg= MIME-Version: 1.0 Received: by 10.231.167.204 with SMTP id r12mr62507iby.31.1268292226109; Wed, 10 Mar 2010 23:23:46 -0800 (PST) In-Reply-To: <20100311071417.GB1035@a-kretschmer.de> References: <2a77004c1003102256l24af41e5ueab35874f5320ffa@mail.gmail.com> <20100311071417.GB1035@a-kretschmer.de> From: Angayarkanni Date: Thu, 11 Mar 2010 12:53:26 +0530 Message-ID: <2a77004c1003102323t6b5e5b98y183fa386f7c978fe@mail.gmail.com> Subject: Re: How to SELECT To: "A. Kretschmer" Cc: pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=0050450159f49bd0890481814b28 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.598 tagged_above=-10 required=5 tests=BAYES_00=-2.599, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201003/125 X-Sequence-Number: 37950 --0050450159f49bd0890481814b28 Content-Type: text/plain; charset=ISO-8859-1 Yes I got Yaar Thanks a lot !!! (Dave Crooke,A. Kretschmer ) Regards, Angayarkanni Kajendran On Thu, Mar 11, 2010 at 12:44 PM, A. Kretschmer < andreas.kretschmer@schollglas.com> wrote: > 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 > > -- > Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-performance > --0050450159f49bd0890481814b28 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Yes I got Yaar

Thanks a lot !!! (
Dave C= rooke,A. Kretschmer )




Regards,
Angayarkanni Kajendran



On Thu, Mar 11, 2010 at 12:44 PM, A. Kre= tschmer <andreas.kretschmer@schollglas.com> wrote:
In response to Angayarkanni :
> Hi,
>
> I am the beginner of pgpsql
>
> =A0
> 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 'ta= ble 2', * from t2;


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

--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

--0050450159f49bd0890481814b28--