Home » Developer & Programmer » Forms » query
query [message #255578] Wed, 01 August 2007 04:22 Go to next message
meeta
Messages: 28
Registered: January 2000
Junior Member
Hi all,
i have a table with thse structure abc(vi number,v2 number,v3 number)
Data is like this
Quote:
abc
vi v2 v3
0 0 10
30 0 0
0 20 0


i want to have following output
Quote:
v
10
20
30

Kindly help me how to do so, i need to select any non zero value from thses 3 columns
icon14.gif  Re: query [message #255582 is a reply to message #255578] Wed, 01 August 2007 04:26 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
use DECODE function... I m 100% sure that your problem will be solved... Razz
Re: query [message #255593 is a reply to message #255582] Wed, 01 August 2007 04:37 Go to previous messageGo to next message
meeta
Messages: 28
Registered: January 2000
Junior Member
Hi thanks,
i tried using decode but it didnt work out
can u tell me hw to do it using decode
Re: query [message #255810 is a reply to message #255593] Wed, 01 August 2007 16:14 Go to previous message
Littlefoot
Messages: 20900
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
GREATEST might be a function you are looking for:
SQL> select * From abc;

        VI         V2         V3
---------- ---------- ----------
         0          0         10
        30          0          0
         0         20          0

SQL> select greatest(vi, v2, v3) from abc;

GREATEST(VI,V2,V3)
------------------
                10
                30
                20
Previous Topic: Save seleted record
Next Topic: regarding quries using in oracle forms
Goto Forum:
  


Current Time: Thu Dec 08 12:51:51 CST 2016

Total time taken to generate the page: 0.04706 seconds