how to get max value of 4 column

Posted on 2011-10-31
Last Modified: 2012-05-12

Hi i have one table . in that table 8 column 4 cloumn are numeric cloum . i want to get max value of that 4 cloumn

Fname     lName    tname    country  n1   n2    n3 n4
Sathish    kumar     ML           India     4    8       9    10
Kumar      Siva       ML           inida     7    6        4     12

if i run the query means i want to get  
12   as result

How to get that ??
    1 Comment
    LVL 76

    Accepted Solution

    select greatest(n1,n2,n3,n4)  from table;

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
    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.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
    This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

    728 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

    17 Experts available now in Live!

    Get 1:1 Help Now