Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4108270
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:37:53+00:00 2026-05-20T21:37:53+00:00

My friend asked this question to me – You are given a table with

  • 0

My friend asked this question to me –

You are given a table with just one field which is an integer. Can
you get the highest value in the field without using the MAX function
?

I think we can change the sign of each column and find the minimum using MIN function. Is that correct?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:37:54+00:00Added an answer on May 20, 2026 at 9:37 pm

    Why you would ignore using the function supported on any database is anyone’s guess, especially if you’d use the MIN function, but…

    GREATEST

    …some database vendors support the GREATEST function:

    SELECT GREATEST(column)
      FROM ...
    

    GREATEST returns the highest value, of all the columns specified. Those that support GREATEST include:

    • MySQL
    • Oracle
    • PostgreSQL

    TOP/LIMIT

    TOP is SQL Server (2000+) only:

      SELECT TOP 1 column
        FROM YOUR_TABLE
    ORDER BY column DESC
    

    LIMIT is only supported by MySQL, PostgreSQL and SQLite

      SELECT column
        FROM YOUR_TABLE
    ORDER BY column DESC
       LIMIT 1
    

    ROW_NUMBER

    ROW_NUMBER is supported by PostgreSQL 8.4+, Oracle 9i+, SQL Server 2005+:

    SELECT x.col
      FROM (SELECT column AS col, 
                   ROW_NUMBER() OVER (ORDER BY column DESC) AS rank
              FROM YOUR_TABLE) x
     WHERE x.rank = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is just a random question my friend asked me which I also do
One of my friend was asked this question in an interview - You have
A friend just asked me this interesting question and I had no answer to
I was asked this question by a friend, and it piqued my curiosity, and
My friend asked me this question today. How to test a vending machine and
I asked to my friend about this question, he said that it is used
this is an interview question my friend was asked yesterday. The question was something
Yesterday my friend asked me a question about this query: select * from user
This question was asked in an interview for my friend. The interviewer asked to
I think this question is best asked with a small code snippet I just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.