View previous topic :: View next topic
|
Author |
Message |
spriya
New User
Joined: 06 Oct 2005 Posts: 42
|
|
|
|
Hi friends ,
please give query for the following situation
Give an employee table with employee number, name and date of joining details write a query to get the name of the employee who is senior most in the organization |
|
Back to top |
|
|
Hanfur
Active User
Joined: 21 Jun 2006 Posts: 104
|
|
|
|
Assmuning your date is stored as YYYY-MM-DD format in column of table
EMP
=============
Hire-Date Name
------------------------
2006-02-09 Albert
1995-02-06 Susan
Then issuing the SQL
SELECT MIN(Hire-Date) FROM EMP ;
This would give the senior employee in EMP table.
EMP
=============
Hire-Date Name
------------------------
1995-02-06 Susan |
|
Back to top |
|
|
Hanfur
Active User
Joined: 21 Jun 2006 Posts: 104
|
|
|
|
Assuming your date is stored as YYYY-MM-DD format in column of table
EMP
=============
Hire-Date Name
------------------------
2006-02-09 Albert
1995-02-06 Susan
Then issuing the SQL
SELECT MIN(Hire-Date) FROM EMP ;
This would give the senior employee in EMP table.
EMP
=============
Hire-Date Name
------------------------
1995-02-06 Susan
-Han |
|
Back to top |
|
|
|