Solved

Getting max value in oracle

Posted on 2008-10-06
5
526 Views
Last Modified: 2013-12-18
Hello All,

I have a table with 4 columns.

Table A
Column1, Column2, COlumn3, Column4

I want to get Column1 and the max value of Column2, Column3, COlumn4. Can some one please provide me with an example on how to do this.

I am writing this query against Oracle database.

Any help is appreciated.

Thanks,
SRM.
0
Comment
Question by:SRM19
  • 3
  • 2
5 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22654001
that looks like:
SELECT Column1, MAX(Column2), MAX(Column3), MAX(Column4) FROM TABLE_A GROUP BY Column1 
but you might not have told the entire story?

Open in new window

0
 

Author Comment

by:SRM19
ID: 22654071
angell, thanks for the solution but that is not what I am looking for. I want the max of 3 columns(column2, column3, column4)
something like this max(column2, column3, column4).

Thanks.
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22654106
I see
SELECT Column1, GREATEST(Column2, Column3 , Column4) FROM TABLE_A  

Open in new window

0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22654110
0
 

Author Comment

by:SRM19
ID: 22654192
thanks angellll, it worked great.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now