Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 12F789FB83B for ; Thu, 12 Jul 2007 03:45:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 14064-06-5 for ; Thu, 12 Jul 2007 03:45:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from pro33.abac.com (pro33.abac.com [66.226.64.34]) by postgresql.org (Postfix) with ESMTP id DB2D29FB6C8 for ; Thu, 12 Jul 2007 03:45:37 -0300 (ADT) Received: from ashishk (ppp92-7.vsnl.eth.net [61.17.93.7] (may be forged)) (authenticated bits=0) by pro33.abac.com (8.13.8/8.13.8) with ESMTP id l6C6jPTD033502 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 11 Jul 2007 23:45:30 -0700 (PDT) (envelope-from ashish.karalkar@info-spectrum.com) Message-ID: <005401c7c450$3d6670e0$170211ac@LIONKING.COM> From: "Ashish Karalkar" To: Subject: Using case or if to return multiple rows Date: Thu, 12 Jul 2007 12:15:24 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_004D_01C7C47E.53188DF0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/60 X-Sequence-Number: 28795 This is a multi-part message in MIME format. ------=_NextPart_000_004D_01C7C47E.53188DF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello all, I want to select data from two diffrent table based on third tables = column somthing like: select case when t3.date=3D'xxxx' then select * from table1 else=20 select * from table 2 =20 from table3 t3 where t3.date=3D'xxxxx' Problem is that I have to do it in Plain SQL. Is there a anyway. Thanks in Advance=20 With egards Ashish.... ------=_NextPart_000_004D_01C7C47E.53188DF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello all,
 
 
I want to select data from two diffrent = table based=20 on third tables column
somthing like:
 
 
select case when =  t3.date=3D'xxxx'=20 then
       =20             select * from=20 table1
 
else
          &nbs= p;=20         select * from table 2
        =
 from table3=20  t3           = ; =20 where t3.date=3D'xxxxx'
 
 
Problem is that I have to do it in = Plain=20 SQL.
 
Is there a anyway.
 
Thanks in Advance
 
With egards
Ashish....
 
------=_NextPart_000_004D_01C7C47E.53188DF0--