[SQL] Query On Case structure

2001-10-20 Thread Dinesh Parikh



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 = 
'123' Then 'Numeric Comment'
    
            Else 'String 
Comment'
    
    End     
From 
PDBUser
Where UserIndex = 
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 = 
'123' Then 'Numeric Comment'
    
            Else 'String 
Comment'
    
    End,    

    
    Case When localName Is Null 
Then UserName
    
When localName = 'SuperUser' Then 'Supervisor'
    
            Else 
'NormalUser'
    
    End     

From 
PDBUser
Where UserIndex = 
23;
 
 
Is this possible. If yes then How is it.
Any help/suggestion may be benificial.
 
Regards
Dinesh Parikh
NSTL New Delhi


[SQL] GUID in postgres

2001-10-24 Thread Dinesh Parikh



Hi, 
Is there any concept of sys_Guid in 
postgres.
If yes what is that ??
As i am using GUID in sql and oracle, then 
what is counterpart of this in postgres. It is urgent.
 
Thanks in advance
Bye
Dinesh Parikh