queries for selecting maximum value

oracle India
  • 14 years ago


     i need to select the maximum value of the table . for that , i had written as

     select max(srno) from table1 . if the table is not having any data, in that case wat  can i do. can anyone explains




  • 14 years ago
    Hi Vivek
     I can't get ur problem.
     If ur table having no data then, no data will return.
     Actually what is ur requirement. Becuase u r asking only question for wat can i do.

    Please give me some details of ur requiremet. Don't waste the thread. Before post ur query once again go through ur message, is it viewer can understand ur requirement or not?

    Hari K......

  • 14 years ago



    If no records have been stored in the table it will return a null value. You can try this:




    SELECT MAX(srno) AS 'MAX VALUE' FROM table1;



Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An expert is a man who has made all the mistakes that can be made in a very narrow field” - Niels Bohr