Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 544
  • Last Modified:

Getting max value in oracle

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
SRM19
Asked:
SRM19
  • 3
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
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
 
SRM19Author Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I see
SELECT Column1, GREATEST(Column2, Column3 , Column4) FROM TABLE_A  

Open in new window

0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
0
 
SRM19Author Commented:
thanks angellll, it worked great.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now