User Id :    Password :      New Member   Forgot Password  
Topic: Write an query to get Max,Min,Second max number from the table?
Anamika singh
11 Oct 2010 at 03:18 AM
Write an query to get Max,Min,Second max number from the table?
Re: Write an query to get Max,Min,Second max number from the table?
Gaurav
12 Oct 2010 at 03:07 AM

Answer:- (i) select max(id) from emp
we can get the max id value from this query .
(ii) select min(id) from emp
we can get min id value fom the table emp.
(iii)select max(id) from emp where id<(select max(id) from emp)
this query is combinination of two sql query.

Total Replies: 1
 
Featured Text Ad

Featured Ad