Home » SQL & PL/SQL » SQL & PL/SQL » Regarding Pseudo Columns
Regarding Pseudo Columns [message #312678] Wed, 09 April 2008 10:40 Go to next message
saharookiedba
Messages: 56
Registered: September 2007
Location: PUNE
Member
Hi,

I have a problem in Query,
I have a table softwares_pc_user where i store data regarding softwares belonging to a particular PC or User..

The Rule is, at a time a software cannot belong to a User and PC.
I have records like

pc user software
0  100  x
0  101  y   
12 0    z


Now while Querying, i want to select only software and a pseudocolumn say Usedby which is a flag giving below results

software UsedBy
x        u 
y        u 
z        PC  


Here Usedby will give 'u' if for that record PC is zero,
similarly for PC


Please help me in this...
Thank you....
Re: Regarding Pseudo Columns [message #312682 is a reply to message #312678] Wed, 09 April 2008 10:42 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use DECODE or CASE.

Regards
Michel
Re: Regarding Pseudo Columns [message #312908 is a reply to message #312682] Thu, 10 April 2008 01:44 Go to previous message
saharookiedba
Messages: 56
Registered: September 2007
Location: PUNE
Member
Thanks Michel..
It helped.
Previous Topic: Purge Script
Next Topic: FN return error : invalid identifier
Goto Forum:
  


Current Time: Sun Dec 04 12:59:52 CST 2016

Total time taken to generate the page: 0.07417 seconds