Received: from nh.newgen.co.in ([203.195.148.19]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9KDcAP43555; Sat, 20 Oct 2001 09:38:11 -0400 (EDT) (envelope-from dineshp@newgen.co.in) Received: from dinesh (ws240.newgen.co.in [192.168.5.240]) by nh.newgen.co.in (8.9.3/8.8.7) with SMTP id TAA30379; Sat, 20 Oct 2001 19:08:31 +0530 Message-ID: <001401c1596c$13af7350$f005a8c0@dinesh> From: "Dinesh Parikh" To: , Subject: Query On Case structure Date: Sat, 20 Oct 2001 19:05:26 +0530 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0011_01C1599A.2D4DBEB0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200110/669 X-Sequence-Number: 16476 This is a multi-part message in MIME format. ------=_NextPart_000_0011_01C1599A.2D4DBEB0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi All, Can we create a query to find different values based on different criteria = from a table using case structure. For example Select Into DBComment Case When localComment Is Null Then Comment When localComment =3D '123' Then 'Numeric Comment' Else 'String Comment' End=20=20=20=20=20 =46rom PDBUser Where UserIndex =3D 23; Using such type of structure can we evaluate multiple values. e.g Select DBComment , DBName Case When localComment Is Null Then Comment When localComment =3D '123' Then 'Numeric Comment' Else 'String Comment' End,=20=20=20=20 Case When localName Is Null Then UserName When localName =3D 'SuperUser' Then 'Supervisor' Else 'NormalUser' End=20=20=20=20=20 =46rom PDBUser Where UserIndex =3D 23; Is this possible. If yes then How is it. Any help/suggestion may be benificial. Regards Dinesh Parikh NSTL New Delhi ------=_NextPart_000_0011_01C1599A.2D4DBEB0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi All,
Can we create a query to find different va= lues=20 based on different criteria from a table using case structure. For=20 example
 
Select Into=20 DBComment
  &n= bsp;=20     Case When localComment Is Null Then Comment<= /DIV>
  &n= bsp;=20             When localComment = =3D=20 '123' Then 'Numeric Comment'
  &n= bsp;=20             Else 'String=20 Comment'
  &n= bsp;=20     End    
From=20 PDBUser
Where UserInde= x =3D=20 23;
 
Using such type of structure can we evalua= te=20 multiple values. e.g
 
Select DBComme= nt ,=20 DBName
  &n= bsp;=20     Case When localComment Is Null Then Comment<= /DIV>
  &n= bsp;=20             When localComment = =3D=20 '123' Then 'Numeric Comment'
  &n= bsp;=20             Else 'String=20 Comment'
  &n= bsp;=20     End,   
  &n= bsp;=20     Case When localName Is Null=20 Then UserName
           =     =20 When localName =3D 'SuperUser' Then 'Supervisor'
  &n= bsp;=20             Else=20 'NormalUser'
  &n= bsp;=20     End    
From=20 PDBUser
Where UserInde= x =3D=20 23;
 
 
Is this possible. If yes then How is it.
Any help/suggestion may be benificial.
 
Regards
Dinesh Parikh
NSTL New Delhi
------=_NextPart_000_0011_01C1599A.2D4DBEB0--