Solved

Getting max value in oracle

Posted on 2008-10-06
5
527 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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
query in Oracle forms Builder 2 42
Read only access to a Procedure in oracle? 4 48
How to free up undo space? 3 31
use lov values 2 37
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

864 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

24 Experts available now in Live!

Get 1:1 Help Now