Home » Applications » Oracle Fusion Apps & E-Business Suite » to display maximum value
to display maximum value [message #169974] Mon, 01 May 2006 04:41 Go to next message
shalumadhu
Messages: 6
Registered: February 2006
Location: hyd
Junior Member
hi all,

i have 2 fileds in 2 different tables.
i have to diaply field by comparing the fields in the 2 tables (comparing which field is having maximum value).

can any one of u help me.

Thnaks and Regards,
madhu
Re: to display maximum value [message #169977 is a reply to message #169974] Mon, 01 May 2006 06:29 Go to previous messageGo to next message
orausern
Messages: 826
Registered: December 2005
Senior Member
Use the function called GREATEST..

for example, i created copy of emp table as emp1 , changed value of comm column and got expected result as under:


  1*  select ENAME,COMM from emp  where ename='ALLEN'
SQL> /

ENAME            COMM
---------- ----------
ALLEN             300

SQL> select ENAME,COMM from emp1 where ename='ALLEN';

ENAME            COMM
---------- ----------
ALLEN             400



SQL> select greatest(emp.comm,emp1.comm) from
SQL> emp,emp1 where
SQL> emp.empno=emp1.empno
SQL> and emp.ename='ALLEN'
SQL> /

GREATEST(EMP.COMM,EMP1.COMM)
----------------------------
                         400

Re: to display maximum value [message #170058 is a reply to message #169974] Mon, 01 May 2006 22:36 Go to previous messageGo to next message
manwadkar
Messages: 104
Registered: September 2005
Location: Washington DC
Senior Member

Use decode statement and display value accordingly.
Re: to display maximum value [message #170059 is a reply to message #169977] Mon, 01 May 2006 22:38 Go to previous messageGo to next message
manwadkar
Messages: 104
Registered: September 2005
Location: Washington DC
Senior Member

THis is also a good option.
Re: to display maximum value [message #170087 is a reply to message #169977] Tue, 02 May 2006 01:23 Go to previous message
shalumadhu
Messages: 6
Registered: February 2006
Location: hyd
Junior Member
Hi,

I didnt aware of GREATEST function.
Thank you very much.

Regards,
Madhu
Previous Topic: Oracle Alerts Email Message Truncates When Greater Than 64K Characters
Next Topic: Invalid data
Goto Forum:
  


Current Time: Mon May 20 11:43:42 CDT 2024