Results 1 to 5 of 5

Thread: Compare values of column in a table

  1. #1
    Expert Member
    Join Date
    Oct 2006
    Answers
    209

    Compare values of column in a table

    Can u tell me how we can compare values of column in a table,for example if we have 5 in 1st column,8 in 2nd,and 20 in 3rd,how we can find largest value in column.

    Note : This is the question asked by a visitor Navya. I am posting this in proper forum.


  2. #2
    Expert Member
    Join Date
    Sep 2006
    Answers
    477

    Re: Compare values of column in a table

    Question definitely requires clarification. You say "Values in a column" and then you want to compare three columns?

    [COLOR="Blue"][SIZE="2"]"If you are not living on the edge of your life, you are wasting space"[/SIZE][/COLOR]

    Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"

  3. #3
    Junior Member
    Join Date
    Jul 2008
    Answers
    1

    Re: Compare values of column in a table

    i dont know la i too have same doubt la. Pls let me know?


  4. #4
    Expert Member
    Join Date
    Nov 2008
    Answers
    300

    Re: Compare values of column in a table

    in oracle you can use GREATEST inbuilt function to find the greatest of the multiple values.

    Eg:

    Code:
    SELECT GREATEST(col1,col2,col3) FROM table_name;



  5. #5
    Junior Member
    Join Date
    Mar 2009
    Answers
    2

    Re: Compare values of column in a table

    Are you talking about columns or rows ???
    If rows then you can use the MAX (column_name) function
    I don't think you can do anything about finding out maximum amongst multiple columns.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact