Sunday, March 22, 2009

Max,Min,Second max number

(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.

No comments: