queries for selecting maximum value

oracle India
  • 14 years ago

    hi

     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

     

    regards

    vivek

  • 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?


    Regards
    Hari K......














  • 14 years ago

    Hi,

     

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

     

    COLUMN 'MAX VALUE' NULL 'NO RECORDS'

     

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

     

    CLEAR COLUMN

Post a reply

Enter your message below

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

Contribute

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.

“Programs must be written for people to read, and only incidentally for machines to execute.”